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

		if (JiFenJieMianObj.activeSelf) {
			return;
		}
//		FinishTaskObj.SetActive(false);
		IsShowFinishTask = true;
		IsMakeJiFenStop = false;
		pcvr.CloseAllQiNangArray(PlayerEnum.Null, 1);

		if (!JiFenZongJieMianObj.activeSelf) {
			CoinPlayerCtrl.GetInstanceOne().HiddenPlayerCoin();
			CoinPlayerCtrl.GetInstanceTwo().HiddenPlayerCoin();
			CoinPlayerCtrl.GetInstanceThree().HiddenPlayerCoin();
			CoinPlayerCtrl.GetInstanceFour().HiddenPlayerCoin();
			GameTimeCtrl.GetInstance().HiddenGameTime();
			DaoJuCtrl.GetInstance().HiddenAllPlayerDaoJu();
			DongGanUICtrl.InstanceOne.HiddenDongGanUI();
			DongGanUICtrl.InstanceTwo.HiddenDongGanUI();
			DongGanUICtrl.InstanceThree.HiddenDongGanUI();
			DongGanUICtrl.InstanceFour.HiddenDongGanUI();
			JiFenZongJieMianObj.SetActive(true);
		}
		PaiMingCtrl.GetInstance().ShowGamePaiMing();

		System.GC.Collect();
		JiFenJieMianObj.SetActive(true);
		Invoke("StopJiFenTime", 8f);
	}
    public void StopJiFenTime()
    {
        if (Time.realtimeSinceStartup - TimeStartVal < 8f)
        {
            Debug.Log("Unity:" + "StopJiFenTime -> TimeStartVal was wrong!");
            return;
        }

        if (IsMakeJiFenStop)
        {
            return;
        }
        IsMakeJiFenStop  = true;
        IsShowFinishTask = false;
        JiFenJieMianObj.SetActive(false);
        Debug.Log("Unity:" + "StopJiFenTime...");

        if (GameOverCtrl.IsShowGameOver)
        {
            XkGameCtrl.LoadingGameMovie();
            return;
        }

        CountJiFenOpen++;
#if CREAT_GAME_SCENE
        //动态加载下一关的游戏场景预制文件.
        XkGameCtrl.GetInstance().m_CreatSceneCom.CreatGameScene(CountJiFenOpen);
#endif

#if USE_LOADING_NEXT_SCENE
        //直接加载下一关的游戏场景.
        if (Application.loadedLevel < 4)
        {
            Application.LoadLevel(Application.loadedLevel + 1);
        }
        else
        {
            Application.LoadLevel(0);
        }
#endif

        //CountJiFenOpen = 4; //test.
        if (CountJiFenOpen < 4)
        {
            XKBossXueTiaoCtrl.IsWuDiPlayer          = false;
            XKTriggerStopMovePlayer.IsActiveTrigger = false;
            GameTimeCtrl.GetInstance().OpenGameTime();

            CoinPlayerCtrl.GetInstanceOne().ShwoPlayerCoin();
            CoinPlayerCtrl.GetInstanceTwo().ShwoPlayerCoin();
            CoinPlayerCtrl.GetInstanceThree().ShwoPlayerCoin();
            CoinPlayerCtrl.GetInstanceFour().ShwoPlayerCoin();
            DaoJuCtrl.GetInstance().ShowAllPlayerDaoJu();
            XKPlayerScoreCtrl.ShowPlayerScore(PlayerEnum.Null);
        }
        else
        {
            QuanBuTongGuanCtrl.GetInstance().ShowQuanBuTongGuan();
        }
    }
    public static void SetCoinPlayerFour(int coin)
    {
        if (pcvr.bIsHardWare == false)
        {
            if (coin > 0 && CoinPlayerFour != coin)
            {
                PlayTouBiAudio();
                if (coin > CoinPlayerFour)
                {
                    Instance.SetTotalInsertCoins(Instance.m_TotalInsertCoins + (coin - CoinPlayerFour));
                }
            }
        }

        CoinPlayerFour = coin;
        if (CoinPlayerCtrl.GetInstanceFour() != null)
        {
            CoinPlayerCtrl.GetInstanceFour().SetPlayerCoin(coin);
        }

        if (SetPanelUiRoot.GetInstance() != null)
        {
            SetPanelUiRoot.GetInstance().SetCoinStartLabelInfo(1);
        }
    }
    public static void SetCoinPlayerTwo(int coin)
    {
        if (XKGlobalData.GameVersionPlayer != 0)
        {
            CoinPlayerTwo = coin;
            SetCoinPlayerFour(coin);
            return;
        }

        if (pcvr.bIsHardWare == false)
        {
            if (coin > 0 && CoinPlayerTwo != coin)
            {
                PlayTouBiAudio();
                if (coin > CoinPlayerTwo)
                {
                    Instance.SetTotalInsertCoins(Instance.m_TotalInsertCoins + (coin - CoinPlayerTwo));
                }
            }
        }

        CoinPlayerTwo = coin;
        if (CoinPlayerCtrl.GetInstanceTwo() != null)
        {
            CoinPlayerCtrl.GetInstanceTwo().SetPlayerCoin(coin);
        }

        if (SetPanelUiRoot.GetInstance() != null)
        {
            SetPanelUiRoot.GetInstance().SetCoinStartLabelInfo(1);
        }
    }
    public void StopJiFenTime()
    {
        if (Time.realtimeSinceStartup - TimeStartVal < 8f)
        {
            Debug.Log("Unity:" + "StopJiFenTime -> TimeStartVal was wrong!");
            return;
        }

        if (IsMakeJiFenStop)
        {
            return;
        }
        IsMakeJiFenStop  = true;
        IsShowFinishTask = false;
        JiFenJieMianObj.SetActive(false);
        Debug.Log("Unity:" + "StopJiFenTime...");

        if (GameOverCtrl.IsShowGameOver)
        {
            XkGameCtrl.LoadingGameMovie();
            return;
        }

        CountJiFenOpen++;
        //CountJiFenOpen = 4; //test.
        if (CountJiFenOpen < 4)
        {
            XKBossXueTiaoCtrl.IsWuDiPlayer          = false;
            XKTriggerStopMovePlayer.IsActiveTrigger = false;
            if (GameTimeCtrl.GetInstance() != null)
            {
                GameTimeCtrl.GetInstance().OpenGameTime();
            }

            CoinPlayerCtrl.GetInstanceOne().ShwoPlayerCoin();
            CoinPlayerCtrl.GetInstanceTwo().ShwoPlayerCoin();
            CoinPlayerCtrl.GetInstanceThree().ShwoPlayerCoin();
            CoinPlayerCtrl.GetInstanceFour().ShwoPlayerCoin();
            DaoJuCtrl.GetInstance().ShowAllPlayerDaoJu();
            XKPlayerScoreCtrl.ShowPlayerScore(PlayerEnum.Null);
        }
        else
        {
            if (QuanBuTongGuanCtrl.GetInstance() != null)
            {
                QuanBuTongGuanCtrl.GetInstance().ShowQuanBuTongGuan();
            }
        }
    }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        TimeValNet = Time.realtimeSinceStartup;
        switch (PlayerSt)
        {
        case PlayerEnum.PlayerOne:
            _InstanceOne = this;
            if (GameMovieCtrl.IsNoDisplayP1)
            {
                transform.localPosition = new Vector3(0f, -18000f, 0f);
            }
            XKGlobalData.SetCoinPlayerOne(XKGlobalData.CoinPlayerOne);
            InputEventCtrl.GetInstance().ClickStartBtOneEvent += ClickStartBtOneEvent;
            break;

        case PlayerEnum.PlayerTwo:
            _InstanceTwo = this;
            if (GameMovieCtrl.IsNoDisplayP1)
            {
                Vector3 posLoc = transform.localPosition;
                posLoc.x = 0f;
                transform.localPosition = posLoc;
            }
            XKGlobalData.SetCoinPlayerTwo(XKGlobalData.CoinPlayerTwo);
            InputEventCtrl.GetInstance().ClickStartBtTwoEvent += ClickStartBtTwoEvent;
            break;
        }
        SetGameNeedCoin(XKGlobalData.GameNeedCoin);
        SetActiveFreeMode(XKGlobalData.IsFreeMode);
        InsertCoinObj.SetActive(false);
        StartBtObj.SetActive(false);

//		switch(GameTypeCtrl.AppTypeStatic) {
//		case AppGameType.LianJiServer:
//			gameObject.SetActive(false);
//			break;
//		}
    }
Пример #7
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);
    }