IEnumerator CheckPlayerCountLoop()
    {
        bool isStopCheck = false;

        do
        {
            if (Network.peerType == NetworkPeerType.Server)
            {
                if (PlayerCount >= Network.connections.Length)
                {
                    isStopCheck = true;
                    gameObject.SetActive(false);
                    NetCtrl.GetInstance().HandleLoadingGameHiddenLoadingGame();
                    XkPlayerCtrl.GetInstanceCartoon().DelayMoveCartoonCamera();
                    XKGlobalData.GetInstance().PlayGuanKaBeiJingAudio();
                    yield break;
                }
            }
            else
            {
                if (IsHiddenLoadingGame)
                {
                    isStopCheck = true;
                    gameObject.SetActive(false);
                    XkPlayerCtrl.GetInstanceCartoon().DelayMoveCartoonCamera();
                    XKGlobalData.GetInstance().PlayGuanKaBeiJingAudio();
                    yield break;
                }
            }
            yield return(new WaitForSeconds(0.1f));
        } while (!isStopCheck);
    }
 void HiddenLoadingGame()
 {
     Debug.Log("HiddenLoadingGame -> peerType " + Network.peerType);
     if (Network.peerType == NetworkPeerType.Disconnected)
     {
         gameObject.SetActive(false);
         XkPlayerCtrl.GetInstanceCartoon().DelayMoveCartoonCamera();
         XKGlobalData.GetInstance().PlayGuanKaBeiJingAudio();
     }
     else
     {
         StartCoroutine(CheckPlayerCountLoop());
         if (Network.peerType == NetworkPeerType.Client)
         {
             NetCtrl.GetInstance().HandleLoadingGamePlayerCount();
         }
     }
 }
    public static void HandleHeTiPlayerEvent()
    {
        if (IsActiveOpenPlayerUI)
        {
            return;
        }
        IsActiveOpenPlayerUI = true;

        if (Network.peerType == NetworkPeerType.Disconnected ||
            Network.peerType == NetworkPeerType.Client)
        {
            ScreenDanHeiCtrl.GetInstance().OpenScreenDanHui(2);
            XKTriggerClosePlayerUI.ResetIsClosePlayerUI();
        }

        XKPlayerHeTiData.GetInstance().ShowHeTiPlayerObj();
        XkPlayerCtrl.GetInstanceCartoon().RestartMovePlayer(1);
        XkPlayerCtrl.GetInstanceCartoon().MakePlayerMoveToAiMark(AiMarkComStatic);
        XkPlayerCtrl.GetInstanceCartoon().SetPlayerCameraTran();
    }