/// <summary> /// 初始化RankWindow界面管理类 /// 1.查找子界面 /// 2.初始化子界面 /// </summary> public override void InitWindowManager() { base.InitWindowManager(); InitWindowControl(); isNeedWaitHideOver = true; // UIRankDetail子界面 GameObject objRankDetail = GameUtility.FindDeepChild(this.gameObject, "DetailWindowContainer").gameObject; UIRankDetail rankDetailScript = objRankDetail.GetComponent <UIRankDetail>(); if (rankDetailScript == null) { rankDetailScript = objRankDetail.AddComponent <UIRankDetail>(); } allWindows[WindowID.WindowID_Rank_Detail] = rankDetailScript; // UIRankOwnDetail子界面 GameObject objRankOwnDetail = GameUtility.FindDeepChild(this.gameObject, "OwnDetailWindow").gameObject; UIRankOwnDetail rankOwnDetailScript = objRankOwnDetail.GetComponent <UIRankOwnDetail>(); if (rankOwnDetailScript == null) { rankOwnDetailScript = objRankOwnDetail.AddComponent <UIRankOwnDetail>(); } allWindows[WindowID.WindowID_Rank_OwnDetail] = rankOwnDetailScript; }
public void OnBtnClick(GameObject obj) { // item 被点击 UIRankManager.GetInstance().ShowWindow(WindowID.WindowID_Rank_Detail); UIRankDetail detail = (UIRankDetail)UIRankManager.GetInstance().GetGameWindow(WindowID.WindowID_Rank_Detail); detail.UpdateDetailData(lbItemName.text, spIcon.spriteName); Debug.Log("Item clicked."); }