示例#1
0
    void ClickStartBtTwoEvent(pcvr.ButtonState state)
    {
        if (XKGlobalData.GameVersionPlayer != 0)
        {
            return;
        }

        if (XkGameCtrl.IsActivePlayerTwo)
        {
            return;
        }

        if (!StartBtObj.activeSelf)
        {
            return;
        }

        if (GameOverCtrl.IsShowGameOver)
        {
            return;
        }
        XKGlobalData.GetInstance().PlayStartBtAudio();
        SubCoinPlayerTwo();
        StartBtObj.SetActive(false);
        XkGameCtrl.SetActivePlayerTwo(true);
        ActiveZhanDouObj();
    }
示例#2
0
    void ClickStartBtTwoEvent(ButtonState state)
    {
        if (Time.realtimeSinceStartup - TimeValNet < MaxTimeNet)
        {
            return;
        }

        if (GameTypeCtrl.PlayerPCState != PlayerEnum.PlayerTwo)
        {
            return;
        }

        if (XkGameCtrl.IsActivePlayerTwo)
        {
            return;
        }

        if (!StartBtObj.activeSelf)
        {
            return;
        }

        if (GameOverCtrl.IsShowGameOver)
        {
            return;
        }
        XKGlobalData.GetInstance().PlayStartBtAudio();
        SubCoinPlayerTwo();
        StartBtObj.SetActive(false);
        XkGameCtrl.SetActivePlayerTwo(true);
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        _Instance = this;
        if (HandleJsonObj == null)
        {
            HandleJsonObj = HandleJson.GetInstance();
        }
        Time.timeScale = 1.0f;
        GameOverCtrl.IsShowGameOver = false;
        pcvr.DongGanState           = 1;
        StarObj               = StarTran.gameObject;
        DirAdjustObj          = AdjustDir.gameObject;
        AdjustYouMenShaCheObj = AdjustYouMenShaCheUI.gameObject;
        QiNangCQObj.SetActive(false);
        XkGameCtrl.SetActivePlayerOne(false);
        XkGameCtrl.SetActivePlayerTwo(false);
        XkGameCtrl.SetActivePlayerThree(false);
        XkGameCtrl.SetActivePlayerFour(false);
        pcvr.CloseAllQiNangArray(PlayerEnum.Null, 1);
        pcvr.OpenCheckYouMenValInfo();
        pcvr.GetInstance().CloseFangXiangPanPower();
        SetGameTextInfo();

        SetStarObjActive(true);
        SetAnJianTestPanel(1);

        InitHandleJson();
        InitStarImgPos();
        InitCoinStartLabel();
        InitGameDiffDuiGou();
        InitGameModeDuiGou();
        InitGameDianJiSpeed();
        InitGameAudioValue();
        InitGameVersionPlayer();

        InputEventCtrl.GetInstance().ClickSetEnterBtEvent         += ClickSetEnterBtEvent;
        InputEventCtrl.GetInstance().ClickSetMoveBtEvent          += ClickSetMoveBtEvent;
        InputEventCtrl.GetInstance().ClickFireBtOneEvent          += ClickFireBtOneEvent;
        InputEventCtrl.GetInstance().ClickFireBtTwoEvent          += ClickFireBtTwoEvent;
        InputEventCtrl.GetInstance().ClickFireBtThreeEvent        += ClickFireBtThreeEvent;
        InputEventCtrl.GetInstance().ClickFireBtFourEvent         += ClickFireBtFourEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtOneEvent        += ClickDaoDanBtOneEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtTwoEvent        += ClickDaoDanBtTwoEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtThreeEvent      += ClickDaoDanBtThreeEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtFourEvent       += ClickDaoDanBtFourEvent;
        InputEventCtrl.GetInstance().ClickStartBtOneEvent         += ClickStartBtEventP1;
        InputEventCtrl.GetInstance().ClickStartBtTwoEvent         += ClickStartBtEventP2;
        InputEventCtrl.GetInstance().ClickStartBtThreeEvent       += ClickStartBtEventP3;
        InputEventCtrl.GetInstance().ClickStartBtFourEvent        += ClickStartBtEventP4;
        InputEventCtrl.GetInstance().ClickStopDongGanBtOneEvent   += ClickStopDongGanBtEventP1;
        InputEventCtrl.GetInstance().ClickStopDongGanBtTwoEvent   += ClickStopDongGanBtEventP2;
        InputEventCtrl.GetInstance().ClickStopDongGanBtThreeEvent += ClickStopDongGanBtEventP3;
        InputEventCtrl.GetInstance().ClickStopDongGanBtFourEvent  += ClickStopDongGanBtEventP4;
    }
示例#4
0
    /// <summary>
    /// 被空袭击中UI提示动画结束事件响应.
    /// </summary>
    public void OnAnimationEnvent()
    {
        if (GameUICenterCtrl.GetInstance() != null)
        {
            GameUICenterCtrl.GetInstance().RemoveKongXiJiZhongUI();
        }

        if (!JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            DaoJiShiCtrl.GetInstance().StartPlayDaoJiShi();
        }
        XkGameCtrl.SetActivePlayerOne(false);
        XkGameCtrl.SetActivePlayerTwo(false);
    }
    // Use this for initialization
    void Start()
    {
        _Instance = this;
        if (HandleJsonObj == null)
        {
            HandleJsonObj = HandleJson.GetInstance();
        }
        Time.timeScale = 1.0f;
        GameOverCtrl.IsShowGameOver = false;
        //pcvr.DongGanState = 1;
        StarObj = StarTran.gameObject;
        XkGameCtrl.SetActivePlayerOne(false);
        XkGameCtrl.SetActivePlayerTwo(false);
        XkGameCtrl.SetActivePlayerThree(false);
        //XkGameCtrl.SetActivePlayerFour(false);
        //SetGameTextInfo();

        SetStarObjActive(true);

        InitHandleJson();
        InitStarImgPos();
        InitCoinStartLabel();
        InitGameDiffDuiGou();
        InitGameModeDuiGou();
        InitCoinToCard();
        InitPrintCaiPiaoUI();
        InitCaiPiaoPrintState();
        //InitGameAudioValue();

        InputEventCtrl.GetInstance().ClickSetEnterBtEvent += ClickSetEnterBtEvent;
        InputEventCtrl.GetInstance().ClickSetMoveBtEvent  += ClickSetMoveBtEvent;

        InputEventCtrl.GetInstance().ClickFireBtOneEvent   += ClickFireBtOneEvent;
        InputEventCtrl.GetInstance().ClickFireBtTwoEvent   += ClickFireBtTwoEvent;
        InputEventCtrl.GetInstance().ClickFireBtThreeEvent += ClickFireBtThreeEvent;

        InputEventCtrl.GetInstance().ClickDaoDanBtOneEvent   += ClickDaoDanBtOneEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtTwoEvent   += ClickDaoDanBtTwoEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtThreeEvent += ClickDaoDanBtThreeEvent;

        InputEventCtrl.GetInstance().ClickStartBtOneEvent   += ClickStartBtEventP1;
        InputEventCtrl.GetInstance().ClickStartBtTwoEvent   += ClickStartBtEventP2;
        InputEventCtrl.GetInstance().ClickStartBtThreeEvent += ClickStartBtEventP3;

        //InputEventCtrl.GetInstance().click += ClickStartBtEventP1;
        //InputEventCtrl.GetInstance().ClickStartBtTwoEvent += ClickStartBtEventP2;
        //InputEventCtrl.GetInstance().ClickStartBtThreeEvent += ClickStartBtEventP3;
    }
    /**
     * 防止在进入关闭UI之前,主角死亡播放倒计时,当倒计时结束后游戏会退回循环动画的bug.
     */
    public static void CheckIsPlayDaoJiShi()
    {
        if (DaoJiShiCtrl.GetInstance().GetIsPlayDaoJishi())
        {
            DaoJiShiCtrl.GetInstance().StopDaoJiShi();
            XkGameCtrl.PlayerYouLiangCur = 3f;
            if (DaoJiShiCtrl.IsActivePlayerOne)
            {
                XkGameCtrl.SetActivePlayerOne(true);
                DaoJiShiCtrl.IsActivePlayerOne = false;
            }

            if (DaoJiShiCtrl.IsActivePlayerTwo)
            {
                XkGameCtrl.SetActivePlayerTwo(true);
                DaoJiShiCtrl.IsActivePlayerTwo = false;
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        _Instance                 = this;
        Time.timeScale            = 1.0f;
        IsOpenSetPanel            = true;
        XkGameCtrl.IsLoadingLevel = false;

        XkGameCtrl.ResetIsLoadingLevel();
        if (pcvr.GetInstance() != null)
        {
            pcvr.GetInstance().CloseFangXiangPanPower(PlayerEnum.Null);
        }
        pcvr.CloseAllQiNangArray(1);
        pcvr.OpenPlayerGunZhenDong();
        if (GameMovieCtrl.IsActivePlayer)
        {
            if (GameTypeCtrl.AppTypeStatic == AppGameType.DanJiFeiJi ||
                GameTypeCtrl.AppTypeStatic == AppGameType.LianJiFeiJi)
            {
                GameJiTai = GameJiTaiType.FeiJiJiTai;
            }

            if (GameTypeCtrl.AppTypeStatic == AppGameType.DanJiTanKe ||
                GameTypeCtrl.AppTypeStatic == AppGameType.LianJiTanKe)
            {
                GameJiTai = GameJiTaiType.TanKeJiTai;
            }

            if (GameTypeCtrl.AppTypeStatic == AppGameType.LianJiServer ||
                GameTypeCtrl.AppTypeStatic == AppGameType.Null)
            {
                GameJiTai = GameJiTaiType.Null;
            }
        }
        GameOverCtrl.IsShowGameOver = false;
        pcvr.OpenDongGanState();
        pcvr.StartLightStateP1 = LedState.Mie;
        pcvr.StartLightStateP2 = LedState.Mie;
        XkGameCtrl.SetActivePlayerOne(false);
        XkGameCtrl.SetActivePlayerTwo(false);

        switch (GameJiTai)
        {
        case GameJiTaiType.TanKeJiTai:
            TanKeStarPos    = TankStarPosTmp;
            SetPanelStarPos = TanKeStarPos;
            break;

        case GameJiTaiType.FeiJiJiTai:
            FeiJiStarPos    = TankStarPosTmp;
            SetPanelStarPos = FeiJiStarPos;
            break;
        }
        StarObj = StarTran.gameObject;
        SetStarObjActive(true);

        InitHandleJson();
        InitStarImgPos();
        InitGameAudioValue();
        InitCoinStartLabel();
        InitGameDiffDuiGou();
        InitGameModeDuiGou();
        InitGunZDInfo();
        InitDianJiSpeedInfo();
        SetGameLanguageVal();

        InputEventCtrl.GetInstance().ClickSetEnterBtEvent       += ClickSetEnterBtEvent;
        InputEventCtrl.GetInstance().ClickSetMoveBtEvent        += ClickSetMoveBtEvent;
        InputEventCtrl.GetInstance().ClickFireBtOneEvent        += ClickFireBtOneEvent;
        InputEventCtrl.GetInstance().ClickFireBtTwoEvent        += ClickFireBtTwoEvent;
        InputEventCtrl.GetInstance().ClickStartBtOneEvent       += ClickStartBtEventP1;
        InputEventCtrl.GetInstance().ClickStartBtTwoEvent       += ClickStartBtEventP2;
        InputEventCtrl.GetInstance().ClickDaoDanBtOneEvent      += ClickDaoDanBtOneEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtTwoEvent      += ClickDaoDanBtTwoEvent;
        InputEventCtrl.GetInstance().ClickStopDongGanBtOneEvent += ClickStopDongGanBtOneEvent;
    }
    // Use this for initialization
    void Start()
    {
        _Instance = this;
        if (GameMovieCtrl.IsActivePlayer)
        {
            IsOpenVR = GameMovieCtrl.IsOpenVR;
        }

        if (IsOpenVR)
        {
            if (GameMovieCtrl.IsHaveDisplayTV)
            {
                VRCameraTr.gameObject.SetActive(false);
            }
            else
            {
                Transform trRoot = transform.root;
                trRoot.parent        = VRCameraTr;
                trRoot.localPosition = new Vector3(0f, 0f, 3f);
            }
        }
        else
        {
            VRCameraTr.gameObject.SetActive(false);
        }
        AudioListener.volume = 1f;
        Time.timeScale       = 1.0f;

        XkGameCtrl.ResetIsLoadingLevel();
//		if (pcvr.GetInstance() != null) {
//			pcvr.GetInstance().CloseFangXiangPanPower(PlayerEnum.Null);
//		}
        pcvr.CloseAllQiNangArray();
//		pcvr.OpenPlayerGunZhenDong();
        if (GameMovieCtrl.IsActivePlayer)
        {
            if (GameTypeCtrl.AppTypeStatic == AppGameType.DanJiFeiJi ||
                GameTypeCtrl.AppTypeStatic == AppGameType.LianJiFeiJi)
            {
                GameJiTai = GameJiTaiType.FeiJiJiTai;
            }

            if (GameTypeCtrl.AppTypeStatic == AppGameType.DanJiTanKe ||
                GameTypeCtrl.AppTypeStatic == AppGameType.LianJiTanKe)
            {
                GameJiTai = GameJiTaiType.TanKeJiTai;
            }

            if (GameTypeCtrl.AppTypeStatic == AppGameType.LianJiServer ||
                GameTypeCtrl.AppTypeStatic == AppGameType.Null)
            {
                //GameJiTai = GameJiTaiType.FeiJiJiTai;
                GameJiTai = GameJiTaiType.TanKeJiTai;
            }
        }
        GameOverCtrl.IsShowGameOver = false;
        pcvr.DongGanState           = 1;
        pcvr.StartLightStateP1      = LedState.Mie;
        pcvr.StartLightStateP2      = LedState.Mie;
        XkGameCtrl.SetActivePlayerOne(false);
        XkGameCtrl.SetActivePlayerTwo(false);

        switch (GameJiTai)
        {
        case GameJiTaiType.TanKeJiTai:
            TanKeStarPos    = TankStarPosTmp;
            SetPanelStarPos = TanKeStarPos;
            break;

        case GameJiTaiType.FeiJiJiTai:
            FeiJiStarPos    = TankStarPosTmp;
            SetPanelStarPos = FeiJiStarPos;
            break;
        }
        StarObj = StarTran.gameObject;
        SetStarObjActive(true);

        InitHandleJson();
        InitStarImgPos();
        InitGameAudioValue();
        InitCoinStartLabel();
        InitGameDiffDuiGou();
        InitGameModeDuiGou();
        InitGunZDInfo();
        SetGameLanguageVal();

        InputEventCtrl.GetInstance().ClickSetEnterBtEvent       += ClickSetEnterBtEvent;
        InputEventCtrl.GetInstance().ClickSetMoveBtEvent        += ClickSetMoveBtEvent;
        InputEventCtrl.GetInstance().ClickFireBtOneEvent        += ClickFireBtOneEvent;
        InputEventCtrl.GetInstance().ClickFireBtTwoEvent        += ClickFireBtTwoEvent;
        InputEventCtrl.GetInstance().ClickStartBtOneEvent       += ClickStartBtEventP1;
        InputEventCtrl.GetInstance().ClickStartBtTwoEvent       += ClickStartBtEventP2;
        InputEventCtrl.GetInstance().ClickDaoDanBtOneEvent      += ClickDaoDanBtOneEvent;
        InputEventCtrl.GetInstance().ClickDaoDanBtTwoEvent      += ClickDaoDanBtTwoEvent;
        InputEventCtrl.GetInstance().ClickStopDongGanBtOneEvent += ClickStopDongGanBtOneEvent;
    }