コード例 #1
0
        private void SetPopupMenu(GameObject Go, int nKinID)
        {
            // 添加右键弹窗
            Go.RemoveComponent <UPopupMenuHandle>();
            UPopupMenuHandle popupMenuHandle = Go.AddComponent <UPopupMenuHandle>();

            if (popupMenuHandle != null)
            {
                UPopupAction popupAction = new UPopupAction();
                popupAction.Add(UPopupItemDataKinView.GetDescString(), new UPopupItemDataKinView(nKinID));
                popupAction.Add(UPopupItemDataCompetitionKinMemberView.GetDescString(), new UPopupItemDataCompetitionKinMemberView(nKinID));

                popupMenuHandle.HandlePopupAction = popupAction;
            }
        }
コード例 #2
0
        public virtual void SetData(UListItemLegendCupRegist item)
        {
            if (item.nIndex <= 0)
            {
                BgIcon.gameObject.SetActive(true);
                ItemView.SetActive(false);
                BgIcon.raycastTarget = false;
                return;
            }
            BgIcon.gameObject.SetActive(true);
            BgIcon.raycastTarget = true;
            ItemView.SetActive(true);

            ItemIndex.text    = item.nIndex.ToString();
            KinName.text      = item.data.szKinName;
            KinLevel.text     = item.data.nKinLevel.ToString();
            KinCupResult.text = item.data.nKinWinNum + "/" + item.data.nKinMaxNum;

            // 颜色设置
            //bool bInThisKin = LogicDataCenter.legendCupDataManager.CheckIsSelfInKinRegistMember(item.data.nKinID);
            int   nSlefKinID = LogicDataCenter.kinDataManager.KinBaseData.nKinID;
            bool  bInThisKin = nSlefKinID == item.data.nKinID;
            Color clrState   = bInThisKin ? UDefines.CommomColor(ECommonColor.ECC_Gold1) : UDefines.CommomColor(ECommonColor.ECC_White);

            ItemIndex.color    = clrState;
            KinName.color      = clrState;
            KinLevel.color     = clrState;
            KinCupResult.color = clrState;

            // 添加右键弹窗
            this.gameObject.RemoveComponent <UPopupMenuHandle>();
            UPopupMenuHandle popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>();

            if (popupMenuHandle != null)
            {
                UPopupAction popupAction = new UPopupAction();
                popupAction.Add(UPopupItemDataKinView.GetDescString(), new UPopupItemDataKinView(item.data.nKinID));
                popupAction.Add(UPopupItemDataRegistKinMemberView.GetDescString(), new UPopupItemDataRegistKinMemberView(item.data.nLegendCupID, item.data.nKinID));

                popupMenuHandle.HandlePopupAction = popupAction;
            }
        }
コード例 #3
0
        public void SetData(legendcup_kininfo kinInfo)
        {
            KinName.text  = kinInfo.szKinName;
            KinName.color = UDefines.CommomColor(ECommonColor.ECC_White);
            if (LogicDataCenter.legendCupDataManager.CheckIsSelfInCompetitionMember(kinInfo.nKinID))
            {
                KinName.color = UDefines.CommomColor(ECommonColor.ECC_Gold1);
            }

            // 添加右键弹窗
            KinName.gameObject.RemoveComponent <UPopupMenuHandle>();
            UPopupMenuHandle popupMenuHandle = KinName.gameObject.AddComponent <UPopupMenuHandle>();

            if (popupMenuHandle != null)
            {
                UPopupAction popupAction = new UPopupAction();
                popupAction.Add(UPopupItemDataKinView.GetDescString(), new UPopupItemDataKinView(kinInfo.nKinID));
                popupAction.Add(UPopupItemDataCompetitionKinMemberView.GetDescString(), new UPopupItemDataCompetitionKinMemberView(kinInfo.nKinID));

                popupMenuHandle.HandlePopupAction = popupAction;
            }
        }