示例#1
0
    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;
            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 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();
            if (GameTimeCtrl.GetInstance() != null)
            {
                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);
    }
示例#3
0
    /// <summary>
    /// Removes the bu ji bao. playerSt == 0 -> hit TerrainLayer,
    /// playerSt == 1 -> PlayerOne, playerSt == 2 -> PlayerTwo.
    /// playerSt == 3 -> PlayerThree, playerSt == 4 -> PlayerFour.
    /// </summary>
    /// <param name="key">Key.</param>
    public void RemoveBuJiBao(PlayerEnum playerSt, int keyHit = 0)
    {
        if (IsDeath)
        {
            return;
        }
        IsDeath = true;
        CancelInvoke("DelayDestroyBuJiBao");
        if (playerSt != PlayerEnum.Null || keyHit == 1)
        {
            //XKGlobalData.GetInstance().PlayAudioHitBuJiBao();
            if (ExplodeObj != null)
            {
                GameObject obj = (GameObject)Instantiate(ExplodeObj, transform.position, transform.rotation);
                XkGameCtrl.CheckObjDestroyThisTimed(obj);
            }

            if (Network.peerType != NetworkPeerType.Server)
            {
                bool isMoveDaoJu = true;
                switch (BuJiBao)
                {
                case BuJiBaoType.FenShuDJ:
                    isMoveDaoJu = false;
                    XKPlayerFenShuCtrl.GetInstance().ShowPlayerFenShu(playerSt, FenShuVal);
                    break;

                case BuJiBaoType.JiSuDJ:
                    //isMoveDaoJu = false;
                    XKPlayerMoveCtrl.SetPlayerJiSuMoveSpeed(playerSt);
                    XKPlayerMoveCtrl.SetPlayerJiSuState(playerSt);
                    XKPlayerJiSuCtrl.GetInstance().ShowPlayerJiSu(playerSt);
                    break;

                case BuJiBaoType.YiLiaoBaoDJ:
                    isMoveDaoJu = false;
                    XkGameCtrl.AddPlayerHealth(playerSt, XKDaoJuGlobalDt.GetInstance().YiLiaoBaoXueLiangVal);
                    XKPlayerJiJiuBaoCtrl.GetInstance().ShowPlayerJiJiuBao(playerSt);
                    break;

                case BuJiBaoType.ShuangBeiFenShuDJ:
                    //isMoveDaoJu = false;
                    //XKDaoJuGlobalDt.SetTimeFenShuBeiLv(playerSt, FenShuBeiLv);
                    XKDaoJuGlobalDt.SetTimeFenShuBeiLv(playerSt, 2);
                    XKFenShuBeiLvCtrl.GetInstance().ShowPlayerFenShuBeiLv(playerSt);
                    break;

                case BuJiBaoType.QianHouFireDJ:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerQianHouFire(playerSt);
                    break;

                case BuJiBaoType.ChangChengJiQiang:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerChangChengFire(playerSt);
                    break;

                case BuJiBaoType.SanDanJiQiang:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerJiQiangSanDanFire(playerSt);
                    break;

                case BuJiBaoType.QiangJiJiQiang:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerQiangJiFire(playerSt);
                    break;

                case BuJiBaoType.PaiJiPaoDJ:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerIsPaiJiPaoFire(playerSt);
                    break;

                case BuJiBaoType.ZhuPaoSanDanDJ:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerIsSanDanZPFire(playerSt);
                    break;

                case BuJiBaoType.HuoLiAllOpenDJ:
                    //isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerIsHuoLiAllOpen(playerSt);
                    XKPlayerHuoLiAllOpenCtrl.GetInstance().ShowPlayerHuoLiOpen(playerSt);
                    break;

                case BuJiBaoType.ChuanTouDan:
                    isMoveDaoJu = false;
                    XKPlayerAutoFire.GetInstanceAutoFire(playerSt).SetAmmoStateZhuPao(PlayerAmmoType.ChuanTouAmmo);
                    break;

                case BuJiBaoType.DaoDan:
                case BuJiBaoType.GaoBaoDan:
                case BuJiBaoType.SanDan:
                case BuJiBaoType.GenZongDan:
                case BuJiBaoType.JianSuDan:
                case BuJiBaoType.NLHuDun:
                    isMoveDaoJu = false;
                    break;
                }

                if (isMoveDaoJu)
                {
                    DaoJuCtrl.GetInstance().MoveDaoJuObjToPlayer(playerSt, transform);
                }
            }
        }
        DestroyNetObj(gameObject);
    }
    /// <summary>
    /// Removes the bu ji bao. playerSt == 0 -> hit TerrainLayer,
    /// playerSt == 1 -> PlayerOne, playerSt == 2 -> PlayerTwo.
    /// playerSt == 3 -> PlayerThree, playerSt == 4 -> PlayerFour.
    /// </summary>
    /// <param name="key">Key.</param>
    public void RemoveBuJiBao(PlayerEnum playerSt, int keyHit = 0)
    {
        if (IsDeath)
        {
            return;
        }
        IsDeath = true;
        CancelInvoke("DelayDestroyBuJiBao");
        if (playerSt != PlayerEnum.Null || keyHit == 1)
        {
            //XKGlobalData.GetInstance().PlayAudioHitBuJiBao();
            if (ExplodeObj != null)
            {
                GameObject obj = (GameObject)Instantiate(ExplodeObj, transform.position, transform.rotation);
                if (obj != null)
                {
                    obj.transform.SetParent(XkGameCtrl.PlayerAmmoArray);
                }

                XkGameCtrl.CheckObjDestroyThisTimed(obj);
                if (obj != null && IsCaiPiaoDaoJu)
                {
                    if (XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage != null)
                    {
                        int value = XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.GetPrintCaiPiaoValueByDeCaiState(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.SuiJiDaoJu, DaoJuType);
                        SSCaiPiaoLiZiManage caiPiaoLiZi = obj.GetComponent <SSCaiPiaoLiZiManage>();
                        if (caiPiaoLiZi != null)
                        {
                            caiPiaoLiZi.ShowNumUI(value, playerSt);
                        }
                        else
                        {
                            Debug.LogWarning("CreatLiZi -> caiPiaoLiZi was null.................");
                        }
                    }

                    if (XkGameCtrl.GetInstance().m_CaiPiaoFlyData != null)
                    {
                        //初始化飞出的彩票逻辑.
                        XkGameCtrl.GetInstance().m_CaiPiaoFlyData.InitCaiPiaoFly(obj.transform.position, playerSt, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.SuiJiDaoJu);
                    }
                    else
                    {
                        Debug.LogWarning("CreatLiZi -> m_CaiPiaoFlyData was null............");
                    }
                }
            }

            if (Network.peerType != NetworkPeerType.Server)
            {
                bool isMoveDaoJu = true;
                switch (BuJiBao)
                {
                case BuJiBaoType.FenShuDJ:
                    isMoveDaoJu = false;
                    XKPlayerFenShuCtrl.GetInstance().ShowPlayerFenShu(playerSt, FenShuVal);
                    break;

                case BuJiBaoType.JiSuDJ:
                    //isMoveDaoJu = false;
                    XKPlayerMoveCtrl.SetPlayerJiSuMoveSpeed(playerSt);
                    XKPlayerMoveCtrl.SetPlayerJiSuState(playerSt);
                    XKPlayerJiSuCtrl.GetInstance().ShowPlayerJiSu(playerSt);
                    break;

                case BuJiBaoType.YiLiaoBaoDJ:
                    isMoveDaoJu = false;
                    XkGameCtrl.AddPlayerHealth(playerSt, XKDaoJuGlobalDt.GetInstance().YiLiaoBaoXueLiangVal);
                    XKPlayerJiJiuBaoCtrl.GetInstance().ShowPlayerJiJiuBao(playerSt);
                    break;

                case BuJiBaoType.ShuangBeiFenShuDJ:
                    isMoveDaoJu = false;
                    //XKDaoJuGlobalDt.SetTimeFenShuBeiLv(playerSt, FenShuBeiLv);
                    //XKDaoJuGlobalDt.SetTimeFenShuBeiLv(playerSt, 2);
                    //XKFenShuBeiLvCtrl.GetInstance().ShowPlayerFenShuBeiLv(playerSt);
                    break;

                case BuJiBaoType.QianHouFireDJ:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerQianHouFire(playerSt);
                    break;

                case BuJiBaoType.ChangChengJiQiang:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerChangChengFire(playerSt);
                    break;

                case BuJiBaoType.SanDanJiQiang:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerJiQiangSanDanFire(playerSt);
                    break;

                case BuJiBaoType.QiangJiJiQiang:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerQiangJiFire(playerSt);
                    break;

                case BuJiBaoType.PaiJiPaoDJ:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerIsPaiJiPaoFire(playerSt);
                    break;

                case BuJiBaoType.ZhuPaoSanDanDJ:
                    isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerIsSanDanZPFire(playerSt);
                    break;

                case BuJiBaoType.HuoLiAllOpenDJ:
                    //isMoveDaoJu = false;
                    XKDaoJuGlobalDt.SetPlayerIsHuoLiAllOpen(playerSt);
                    XKPlayerHuoLiAllOpenCtrl.GetInstance().ShowPlayerHuoLiOpen(playerSt);
                    break;

                case BuJiBaoType.ChuanTouDan:
                    isMoveDaoJu = false;
                    XKPlayerAutoFire.GetInstanceAutoFire(playerSt).SetAmmoStateZhuPao(PlayerAmmoType.ChuanTouAmmo);
                    break;

                case BuJiBaoType.DaoDan:
                case BuJiBaoType.GaoBaoDan:
                case BuJiBaoType.SanDan:
                case BuJiBaoType.GenZongDan:
                case BuJiBaoType.JianSuDan:
                case BuJiBaoType.NLHuDun:
                    isMoveDaoJu = false;
                    break;
                }

                if (isMoveDaoJu)
                {
                    DaoJuCtrl.GetInstance().MoveDaoJuObjToPlayer(playerSt, transform);
                }
            }
        }
        DestroyNetObj(gameObject);
    }