2023-07-14 19:35:33 +00:00
|
|
|
XUiGridSkillItemOther = XClass(nil, "XUiGridSkillItemOther")
|
|
|
|
|
|
|
|
function XUiGridSkillItemOther:Ctor(rootUi, ui, skill, character, equipList, assignChapterRecords, cb)
|
|
|
|
self.RootUi = rootUi
|
|
|
|
self.GameObject = ui.gameObject
|
|
|
|
self.Transform = ui.transform
|
|
|
|
self.SkillInfo = skill
|
|
|
|
self.EquipList = equipList
|
|
|
|
self.Character = character
|
|
|
|
self.AssignChapterRecords = assignChapterRecords
|
|
|
|
self.ClickCallback = cb
|
|
|
|
self:InitAutoScript()
|
|
|
|
|
|
|
|
self:UpdateInfo(self.SkillInfo)
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridSkillItemOther:InitAutoScript()
|
|
|
|
self.SpecialSoundMap = {}
|
|
|
|
self:AutoInitUi()
|
|
|
|
self:AutoAddListener()
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridSkillItemOther:AutoInitUi()
|
|
|
|
self.RImgSkillIcon = XUiHelper.TryGetComponent(self.Transform, "RImgSkillIcon", "RawImage")
|
|
|
|
self.BtnIconBg = XUiHelper.TryGetComponent(self.Transform, "BtnIconBg", "Button")
|
2024-09-01 20:49:41 +00:00
|
|
|
self.TxtSkillName = XUiHelper.TryGetComponent(self.Transform, "BtnIconBg/ImgBg/TxtSkillName", "Text")
|
2023-07-14 19:35:33 +00:00
|
|
|
self.PanelIconTip = XUiHelper.TryGetComponent(self.Transform, "PanelIconTip", nil)
|
|
|
|
self.ImgUpgradeTip = XUiHelper.TryGetComponent(self.Transform, "PanelIconTip/ImgUpgradeTip", "Image")
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridSkillItemOther:AutoAddListener()
|
|
|
|
XUiHelper.RegisterClickEvent(self, self.BtnIconBg, self.OnBtnIconBgClick)
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridSkillItemOther:OnBtnIconBgClick()
|
|
|
|
if self.ClickCallback then
|
|
|
|
self.ClickCallback()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridSkillItemOther:UpdateInfo(skill)
|
2024-09-01 20:49:41 +00:00
|
|
|
self.TxtSkillName.text = skill.Name
|
2023-07-14 19:35:33 +00:00
|
|
|
self.RImgSkillIcon:SetRawImage(skill.Icon)
|
|
|
|
self.ImgUpgradeTip.gameObject:SetActive(false)
|
|
|
|
end
|