47 lines
1.2 KiB
Lua
47 lines
1.2 KiB
Lua
local this = {}
|
|
--传入父脚本模块
|
|
local parent
|
|
--传入特效层级
|
|
local sortingOrder = 0
|
|
|
|
--初始化组件(用于子类重写)
|
|
function this:InitComponent(gameObject)
|
|
this.spLoader = SpriteLoader.New()
|
|
this.title = Util.GetGameObject(gameObject, "title/Img"):GetComponent("Image")
|
|
this.text1 = Util.GetGameObject(gameObject, "Text1"):GetComponent("Text")
|
|
this.text2 = Util.GetGameObject(gameObject, "Text2/Text"):GetComponent("Text")
|
|
end
|
|
|
|
--绑定事件(用于子类重写)
|
|
function this:BindEvent()
|
|
end
|
|
|
|
--添加事件监听(用于子类重写)
|
|
function this:AddListener()
|
|
end
|
|
|
|
--移除事件监听(用于子类重写)
|
|
function this:RemoveListener()
|
|
end
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
function this:OnShow(_parent, ...)
|
|
parent = _parent
|
|
sortingOrder = _parent.sortingOrder
|
|
local data = ...
|
|
this.title.sprite = this.spLoader:LoadSprite(data.NamePic2)
|
|
this.text1.text = GetLanguageStrById(data.RealmDesc1)
|
|
this.text2.text = GetLanguageStrById(data.RealmDesc2)
|
|
end
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
function this:OnClose()
|
|
end
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
function this:OnDestroy()
|
|
this.spLoader:Destroy()
|
|
end
|
|
|
|
return this
|