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(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