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

67 lines
1.8 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.

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:New(gameObject)
local b = {}
b.gameObject = gameObject
b.transform = gameObject.transform
setmetatable(b, { __index = RoleStoryLayout })
return b
end
--初始化组件(用于子类重写)
function RoleStoryLayout:InitComponent()
self.spLoader = SpriteLoader.New()
self.infoTextStory = Util.GetGameObject(self.gameObject ,"infoBg/infoRect/infoText"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function RoleStoryLayout:BindEvent()
end
--添加事件监听(用于子类重写)
function RoleStoryLayout:AddListener()
end
--移除事件监听(用于子类重写)
function RoleStoryLayout:RemoveListener()
end
function RoleStoryLayout:OnSortingOrderChange()
end
function RoleStoryLayout:OnShow()
self.gameObject:SetActive(true)
end
function RoleStoryLayout:SetData(_sortinglayer,_parent,_curHerodata,_isUpZhen,_heroDatas)
curHeroData = _curHerodata
local story = curHeroData.heroConfig and curHeroData.heroConfig.HeroStory or curHeroData.HeroStory
self.infoTextStory.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(-2, 0)
local stroyStr = string.gsub(GetLanguageStrById(story),"#","\n")
self.infoTextStory.text = string.gsub(stroyStr,"|","  ")--传记
end
function RoleStoryLayout:OnHide()
self.gameObject:SetActive(false)
end
function RoleStoryLayout:OnClose()
end
function RoleStoryLayout:OnDestroy()
self.spLoader:Destroy()
end
return RoleStoryLayout