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();
        }
    }
    public void ShowFinishTaskInfo()
    {
        if (IsShowFinishTask)
        {
            return;
        }
        IsShowFinishTask = true;
        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);

        if (Network.peerType == NetworkPeerType.Server)
        {
            ScreenDanHeiCtrl.GetInstance().OpenPlayerUI();
            if (GameOverCtrl.IsShowGameOver)
            {
                GameOverObj.SetActive(true);
            }
            else
            {
                FinishTaskObj.SetActive(true);
            }
            return;
        }
        FinishTaskObj.SetActive(true);
        XKGlobalData.GetInstance().PlayAudioRenWuOver();
    }
    // Use this for initialization
    void Start()
    {
        switch (PlayerSt)
        {
        case PlayerEnum.PlayerOne:
            InstanceOne = this;
            if (!XkGameCtrl.IsActivePlayerOne)
            {
                HiddenPlayerDanYaoInfo();
            }
            break;

        case PlayerEnum.PlayerTwo:
            InstanceTwo = this;
            if (!XkGameCtrl.IsActivePlayerTwo)
            {
                HiddenPlayerDanYaoInfo();
            }
            break;
        }

//		XkGameCtrl.GaoBaoDanNumPOne = 5; //test
//		XkGameCtrl.GaoBaoDanNumPTwo = 5; //test
        InitPlayerDanYaoInfo();
    }
Esempio n. 4
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);
    }