From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/SpectateLevelRewardBehaviour.cs | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/SpectateLevelRewardBehaviour.cs (limited to 'Client/Assets/Scripts/XMainClient/SpectateLevelRewardBehaviour.cs') diff --git a/Client/Assets/Scripts/XMainClient/SpectateLevelRewardBehaviour.cs b/Client/Assets/Scripts/XMainClient/SpectateLevelRewardBehaviour.cs new file mode 100644 index 00000000..de530123 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/SpectateLevelRewardBehaviour.cs @@ -0,0 +1,80 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class SpectateLevelRewardBehaviour : DlgBehaviourBase + { + private static uint maxPlayerNum = 4u; + + private static uint maxMessageNum = 8u; + + public int MemberHeight; + + public int MemberStartY; + + public IXUISprite m_BackToMainCityBtn; + + public IXUILabel m_WatchNum; + + public IXUISprite m_GoOnBtn; + + public IXUILabel m_GoOnBtnText; + + public IXUILabel m_CommendNum; + + public XUIPool m_TitlePool = new XUIPool(XSingleton.singleton.m_uiTool); + + public XUIPool m_MemberPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public XUIPool m_DetailPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public XUIPool m_SplitPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public XUIPool m_LabelPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public XUIPool m_StarPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public XUIPool m_WinLosePool = new XUIPool(XSingleton.singleton.m_uiTool); + + public GameObject m_MVP; + + public Transform m_TitleParent; + + public Transform m_MemberParent; + + private void Awake() + { + this.m_BackToMainCityBtn = (base.transform.Find("Bg/BackBtn").GetComponent("XUISprite") as IXUISprite); + this.m_GoOnBtn = (base.transform.Find("Bg/GoonBtn").GetComponent("XUISprite") as IXUISprite); + this.m_GoOnBtnText = (this.m_GoOnBtn.gameObject.transform.Find("T").GetComponent("XUILabel") as IXUILabel); + this.m_WatchNum = (base.transform.Find("Bg/WatchNum").GetComponent("XUILabel") as IXUILabel); + this.m_CommendNum = (base.transform.Find("Bg/CommendNum").GetComponent("XUILabel") as IXUILabel); + Transform transform = base.transform.Find("AllTpl/Title"); + this.m_TitlePool.SetupPool(transform.parent.gameObject, transform.gameObject, SpectateLevelRewardBehaviour.maxMessageNum, false); + transform = base.transform.Find("AllTpl/Member"); + IXUISprite ixuisprite = transform.GetComponent("XUISprite") as IXUISprite; + this.MemberHeight = ixuisprite.spriteHeight; + this.MemberStartY = (int)(transform.localPosition.y + 0.5f); + this.m_MemberPool.SetupPool(transform.parent.gameObject, transform.gameObject, SpectateLevelRewardBehaviour.maxPlayerNum, false); + transform = base.transform.Find("Panel/View"); + this.MemberStartY -= (int)(transform.localPosition.y + 0.5f); + transform = base.transform.Find("AllTpl/Detail"); + this.m_DetailPool.SetupPool(transform.parent.gameObject, transform.gameObject, SpectateLevelRewardBehaviour.maxPlayerNum, false); + transform = base.transform.Find("AllTpl/Split"); + this.m_SplitPool.SetupPool(transform.parent.gameObject, transform.gameObject, SpectateLevelRewardBehaviour.maxPlayerNum * SpectateLevelRewardBehaviour.maxMessageNum, false); + transform = base.transform.Find("AllTpl/Label"); + this.m_LabelPool.SetupPool(transform.parent.gameObject, transform.gameObject, SpectateLevelRewardBehaviour.maxPlayerNum * SpectateLevelRewardBehaviour.maxMessageNum, false); + transform = base.transform.Find("AllTpl/Star"); + this.m_StarPool.SetupPool(transform.parent.gameObject, transform.gameObject, SpectateLevelRewardBehaviour.maxPlayerNum * 3u, false); + transform = base.transform.Find("AllTpl/WinLose"); + this.m_WinLosePool.SetupPool(transform.parent.gameObject, transform.gameObject, SpectateLevelRewardBehaviour.maxPlayerNum, false); + this.m_MVP = base.transform.Find("AllTpl/MVP").gameObject; + this.m_TitleParent = base.transform.Find("Panel/Title"); + this.m_MemberParent = base.transform.Find("Panel/View"); + } + } +} -- cgit v1.1-26-g67d0