miduo_client/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleStoryLayout.lua

59 lines
1.6 KiB
Lua
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

require("Base/BasePanel")
RoleStoryLayout = Inherit(BasePanel)
local this = RoleStoryLayout
local curHeroData--当前英雄信息
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local heroSkinConfig = ConfigManager.GetConfig(ConfigName.HeroSkin)
--初始化组件(用于子类重写)
function RoleStoryLayout:InitComponent(gameObject)
this.gameObject = gameObject
this.infoTextStory = Util.GetGameObject(gameObject,"infoBg/infoRect/infoText"):GetComponent("Text")
return this
end
--绑定事件(用于子类重写)
function RoleStoryLayout:BindEvent()
end
--添加事件监听(用于子类重写)
function RoleStoryLayout:AddListener()
end
--移除事件监听(用于子类重写)
function RoleStoryLayout:RemoveListener()
end
function RoleStoryLayout:OnSortingOrderChange()
end
function RoleStoryLayout:OnShow(_sortinglayer,_parent,_curHerodata)
this.gameObject:SetActive(true)
curHeroData = _curHerodata
this.infoTextStory:GetComponent("RectTransform").anchoredPosition = Vector2.New(-2, 0)
local stroyStr = string.gsub(GetLanguageStrById(curHeroData.heroConfig.HeroStory),"#","\n")
this.infoTextStory.text = string.gsub(stroyStr,"|","  ")--传记
end
function RoleStoryLayout:OnHide()
this.gameObject:SetActive(false)
end
function RoleStoryLayout:OnClose()
end
function RoleStoryLayout:OnDestroy()
end
return RoleStoryLayout