开始开发大厅烹饪功能

This commit is contained in:
2025-08-01 00:33:26 +08:00
parent 608486444e
commit 44fc2371be
25 changed files with 360 additions and 2 deletions

View File

@ -0,0 +1,28 @@
-- 锅的控件
local CookingPot = {}
local Emitter = require("Utils.Emitter")
function CookingPot:ctor()
self.cook_slot_clicked_handle = nil
end
function CookingPot:Construct()
self.cook_slot_clicked_handle = Emitter.OnEvent(
"cook_slot_clicked",
function(slot) self:OnCookSlotClicked(slot) end
)
end
function CookingPot:Destruct()
Emitter.OffEvent("cook_slot_clicked", self.cook_slot_clicked_handle)
end
function CookingPot:OnCookSlotClicked(slot)
local item = slot:ConsumeMaterial()
if item == nil then end
self:PlayAnimation(self.Anim_Cook, 0, 1, 0, 1, false)
end
return Class(nil, nil, CookingPot)