public void ActiveJiFenJieMian()
    {
        if (Network.peerType == NetworkPeerType.Server)
        {
            return;
        }

        if (JiFenJieMianObj.activeSelf)
        {
            return;
        }
        FinishTaskObj.SetActive(false);

        if (!JiFenZongJieMianObj.activeSelf)
        {
            DanYaoInfoCtrl.GetInstanceOne().HiddenPlayerDanYaoInfo();
            DanYaoInfoCtrl.GetInstanceTwo().HiddenPlayerDanYaoInfo();
            ZhunXingCtrl.GetInstanceOne().SetActiveZhunXingObj(false);
            ZhunXingCtrl.GetInstanceTwo().SetActiveZhunXingObj(false);
            CoinPlayerCtrl.GetInstanceOne().HiddenPlayerCoin();
            CoinPlayerCtrl.GetInstanceTwo().HiddenPlayerCoin();
            YouLiangAddCtrl.GetInstance().HiddenYouLiangAdd();
            YouLiangCtrl.GetInstance().HiddenYouLiang();
            JiFenZongJieMianObj.SetActive(true);
        }
        else
        {
            XkGameCtrl.HiddenMissionCleanup();

            if (Network.peerType == NetworkPeerType.Client)
            {
                if (NetCtrl.GetInstance() != null)
                {
                    NetCtrl.GetInstance().TryCloseServerPort();
                }
            }
        }

        System.GC.Collect();
        if (XkPlayerCtrl.GetInstanceFeiJi() != null)
        {
            XkPlayerCtrl.GetInstanceFeiJi().StopPlayerMoveAudio();
        }

        if (XkPlayerCtrl.GetInstanceTanKe() != null)
        {
            XkPlayerCtrl.GetInstanceTanKe().StopPlayerMoveAudio();
        }
        JiFenJieMianObj.SetActive(true);

        if (XkGameCtrl.IsPlayGamePOne)
        {
            XunZhangJBCtrl.GetInstanceOne().ShowPlayerXunZhangJB();
        }

        if (XkGameCtrl.IsPlayGamePTwo)
        {
            XunZhangJBCtrl.GetInstanceTwo().ShowPlayerXunZhangJB();
        }
    }
Esempio n. 2
0
    public void ActiveJiFenJieMian()
    {
        if (Network.peerType == NetworkPeerType.Server)
        {
            return;
        }

        if (JiFenJieMianObj.activeSelf)
        {
            return;
        }
        FinishTaskObj.SetActive(false);

        if (!JiFenZongJieMianObj.activeSelf)
        {
            DanYaoInfoCtrl.GetInstanceOne().HiddenPlayerDanYaoInfo();
            DanYaoInfoCtrl.GetInstanceTwo().HiddenPlayerDanYaoInfo();
            ZhunXingCtrl.GetInstanceOne().SetActiveZhunXingObj(false);
            ZhunXingCtrl.GetInstanceTwo().SetActiveZhunXingObj(false);
            CoinPlayerCtrl.GetInstanceOne().HiddenPlayerCoin();
            CoinPlayerCtrl.GetInstanceTwo().HiddenPlayerCoin();
            YouLiangAddCtrl.GetInstance().HiddenYouLiangAdd();
            YouLiangCtrl.GetInstance().HiddenYouLiang();
            JiFenZongJieMianObj.SetActive(true);
        }
        else
        {
            XkGameCtrl.HiddenMissionCleanup();

            if (Network.peerType == NetworkPeerType.Client)
            {
                if (NetCtrl.GetInstance() != null)
                {
                    NetCtrl.GetInstance().TryCloseServerPort();
                }
            }
        }

        System.GC.Collect();
        if (XkPlayerCtrl.GetInstanceFeiJi() != null)
        {
            XkPlayerCtrl.GetInstanceFeiJi().StopPlayerMoveAudio();
        }

        if (XkPlayerCtrl.GetInstanceTanKe() != null)
        {
            XkPlayerCtrl.GetInstanceTanKe().StopPlayerMoveAudio();
        }
        JiFenJieMianObj.SetActive(true);

        if (XkGameCtrl.IsPlayGamePOne)
        {
            XunZhangJBCtrl.GetInstanceOne().ShowPlayerXunZhangJB();
        }

        if (XkGameCtrl.IsPlayGamePTwo)
        {
            XunZhangJBCtrl.GetInstanceTwo().ShowPlayerXunZhangJB();
        }

        pcvr.CloseGunZhenDongDengJi();
        pcvr.CloseAllQiNangArray();
        if (pcvr.GetInstance() != null)
        {
            pcvr.GetInstance().CloseFangXiangPanPower(PlayerEnum.Null);
        }

        Invoke("DelayForceRestartComPort", 0.5f);
    }