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