miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/MonsterSkillPopup.lua

49 lines
1.7 KiB
Lua
Raw Normal View History

2021-04-21 13:12:04 +08:00
require("Base/BasePanel")
2020-05-09 13:31:21 +08:00
MonsterSkillPopup = Inherit(BasePanel)
local this = MonsterSkillPopup
--初始化组件(用于子类重写)
function MonsterSkillPopup:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2020-05-09 13:31:21 +08:00
this.content = Util.GetGameObject(self.transform, "Content"):GetComponent("RectTransform")
this.backBtn = Util.GetGameObject(self.transform, "Button")
this.skillName = Util.GetGameObject(self.transform, "Content/CurLv/Title/Text"):GetComponent("Text")
this.skillTypeIcon = Util.GetGameObject(self.transform, "Content/CurLv/Title/SkillTypeImage"):GetComponent("Image")
this.skillContent = Util.GetGameObject(self.transform, "Content/CurLv/Text"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function MonsterSkillPopup:BindEvent()
Util.AddClick(this.backBtn, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function MonsterSkillPopup:AddListener()
end
--移除事件监听(用于子类重写)
function MonsterSkillPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
local SkillIconType={"r_hero_pu","r_hero_jue","r_hero_bei"}
function MonsterSkillPopup:OnOpen(skillData)
this.content.anchoredPosition = Vector2.New(0, 0)
this.skillName.text = skillData.Name
2021-04-21 13:12:04 +08:00
this.skillTypeIcon.sprite = this.spLoader:LoadSprite(SkillIconType[skillData.Type])
2020-05-09 13:31:21 +08:00
this.skillContent.text = GetSkillConfigDesc(skillData)
end
--界面关闭时调用(用于子类重写)
function MonsterSkillPopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function MonsterSkillPopup:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-05-09 13:31:21 +08:00
end
2020-06-23 18:36:24 +08:00
return MonsterSkillPopup