Exemple #1
0
        public static void UpdateConfirmBox(GameObject root, ulong confirmPlayerUid)
        {
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            DebugHelper.Assert(roomInfo != null, "Room Info is NULL!!!");
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "RoleInfo is NULL!!!");
            int currentMapPlayerNum = Singleton <CMatchingSystem> .GetInstance().currentMapPlayerNum;

            int confirmPlayerNum = Singleton <CMatchingSystem> .GetInstance().confirmPlayerNum;

            Transform transform = root.transform.Find("Panel/Panel/stateGroup");

            if (transform)
            {
                if ((roomInfo.roomAttrib.bMapType == 3 && masterRoleInfo != null && (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade).bLogicGrade >= CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel && !roomInfo.roomAttrib.bWarmBattle) || roomInfo.roomAttrib.bMapType == 5)
                {
                    if (masterRoleInfo.playerUllUID == confirmPlayerUid)
                    {
                        CUICommonSystem.SetObjActive(transform.Find(string.Format("icon{0}/ready", confirmPlayerNum)), true);
                        CUICommonSystem.SetObjActive(transform.Find(string.Format("icon{0}/unready", confirmPlayerNum)), false);
                    }
                    else
                    {
                        CUITimerScript uITimerScript = CUICommonSystem.GetUITimerScript(transform.Find(string.Format("icon{0}", confirmPlayerNum)));
                        if (uITimerScript != null)
                        {
                            uITimerScript.SetTotalTime((float)Random.Range(1, 4));
                            uITimerScript.SetTimerEventId(enTimerEventType.TimeUp, enUIEventID.Matchingt_ShowConfirmHead);
                            uITimerScript.enabled = true;
                            uITimerScript.StartTimer();
                        }
                    }
                }
                else
                {
                    int num = 1;
                    for (COM_PLAYERCAMP cOM_PLAYERCAMP = COM_PLAYERCAMP.COM_PLAYERCAMP_1; cOM_PLAYERCAMP < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; cOM_PLAYERCAMP++)
                    {
                        ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP];
                        for (int i = 0; i < listView.Count; i++)
                        {
                            MemberInfo memberInfo = listView[i];
                            if (memberInfo.ullUid == confirmPlayerUid)
                            {
                                Transform transform2 = transform.Find(string.Format("icon{0}/ready", num));
                                if (transform2)
                                {
                                    transform2.gameObject.CustomSetActive(true);
                                }
                                Transform transform3 = transform.Find(string.Format("icon{0}/unready", num));
                                if (transform3)
                                {
                                    transform3.gameObject.CustomSetActive(false);
                                }
                                break;
                            }
                            num++;
                        }
                    }
                }
            }
            bool      flag       = roomInfo.roomAttrib.bPkAI == 2;
            int       num2       = (!roomInfo.roomAttrib.bWarmBattle && flag) ? (currentMapPlayerNum / 2) : currentMapPlayerNum;
            Transform transform4 = root.transform.Find("Panel/Panel/TxtReadyNum");

            if (transform4)
            {
                Text component = transform4.GetComponent <Text>();
                if (component)
                {
                    component.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), confirmPlayerNum, num2));
                }
            }
            if (confirmPlayerUid == roomInfo.selfInfo.ullUid)
            {
                Transform transform5 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm");
                if (transform5 != null)
                {
                    Button component2 = transform5.GetComponent <Button>();
                    if (component2)
                    {
                        component2.set_interactable(false);
                    }
                }
            }
        }