烹饪基本流程完成
This commit is contained in:
		| @ -5,6 +5,7 @@ local Emitter = require("Utils.Emitter") | ||||
| local ESlateVisibility = import("ESlateVisibility") | ||||
|  | ||||
| function CookingPot:ctor() | ||||
|     self.cookware_click_handle = nil | ||||
|     self.cook_material_change_handle = nil | ||||
| end | ||||
|  | ||||
| @ -16,10 +17,16 @@ function CookingPot:Construct() | ||||
|         function(cook_material_id, is_auto_push) self:OnCookMaterialChange(cook_material_id, is_auto_push) end | ||||
|     ) | ||||
|  | ||||
|     self.cookware_click_handle = Emitter.OnEvent( | ||||
|         "use_cookward", | ||||
|         function(cookware_id) self:OnUseCookware(cookware_id) end | ||||
|     ) | ||||
|  | ||||
| end | ||||
|  | ||||
| function CookingPot:Destruct() | ||||
|     Emitter.OffEvent("cook_material_change", self.cook_material_change_handle) | ||||
|     Emitter.OffEvent("use_cookward", self.cookware_click_handle) | ||||
| end | ||||
|  | ||||
|  | ||||
| @ -34,6 +41,11 @@ function CookingPot:OnCookMaterialChange(cook_material_id, is_auto_push) | ||||
|     end | ||||
| end | ||||
|  | ||||
| function CookingPot:OnUseCookware(cookware_id) | ||||
|     self:PlayAnimation(self.Anim_StirFry, 0, 1, 0, 1, false) | ||||
| end | ||||
|  | ||||
|  | ||||
| function CookingPot:OnCookSlotClicked(config) | ||||
|     if config == nil then return end | ||||
|     self.MaterialImg:SetVisibility(ESlateVisibility.SelfHitTestInvisible) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user