Exemplo n.º 1
0
    void ChangeDaoJiShiVal()
    {
        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            StopDaoJiShi();
            return;
        }

        if (DaoJiShiCount <= 1)
        {
            StopDaoJiShi();
            ShowGameOverObj();
//			if (XkGameCtrl.PlayerActiveNum <= 0 && CountDaoJiShi > 0) {
//				Debug.LogWarning("Unity:"+"ChangeDaoJiShiVal -> CountDaoJiShi "+CountDaoJiShi);
//			}

            //玩家没有进行续币.
            //重置玩家续币信息.
            XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.ResetPlayerXuBiInfo(PlayerIndex);
            //if (XkGameCtrl.PlayerActiveNum <= 0 && CountDaoJiShi <= 0) {
            //	GameOverCtrl.GetInstance().ShowGameOver();
            //}

            XkGameCtrl.GetInstance().ResetPlayerInfo(PlayerIndex);
            return;
        }

        DaoJiShiCount--;
        DaoJiShiSprite.spriteName = "daoJiShi" + DaoJiShiCount;
        ShowDaoJiShiInfo();
    }
Exemplo n.º 2
0
    void ChangeDaoJiShiVal()
    {
        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            StopDaoJiShi();
            return;
        }

        if (DaoJiShiCount <= 1)
        {
            StopDaoJiShi();
            ShowGameOverObj();
//			if (XkGameCtrl.PlayerActiveNum <= 0 && CountDaoJiShi > 0) {
//				Debug.LogWarning("ChangeDaoJiShiVal -> CountDaoJiShi "+CountDaoJiShi);
//			}

            if (XkGameCtrl.PlayerActiveNum <= 0 && CountDaoJiShi <= 0)
            {
                GameOverCtrl.GetInstance().ShowGameOver();
            }
            return;
        }

        DaoJiShiCount--;
        DaoJiShiSprite.spriteName = "daoJiShi" + DaoJiShiCount;
        ShowDaoJiShiInfo();
    }
    public static void ShowDongGanInfo()
    {
        if (!ScreenDanHeiCtrl.IsStartGame)
        {
            return;
        }

        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (Instance == null)
        {
            return;
        }

        DongGanCount++;
        if (DongGanCount > 1)
        {
            DongGanCount = 0;
        }
        pcvr.DongGanState = (byte)DongGanCount;
        Instance.ShowDongGanUI(DongGanCount);
    }
Exemplo n.º 4
0
    void Update()
    {
        if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            if (InsertCoinObj.activeSelf)
            {
                InsertCoinObj.SetActive(false);
            }

            if (StartBtObj.activeSelf)
            {
                StartBtObj.SetActive(false);
            }
            return;
        }

        CheckPlayerOneCoinCur();
        CheckPlayerTwoCoinCur();
        CheckPlayerThreeCoinCur();
        //CheckPlayerFourCoinCur();

        if (pcvr.bIsHardWare == true && StartBtObj != null && PlayerSt != PlayerEnum.PlayerFour)
        {
            if (StartBtObj.activeInHierarchy == true)
            {
                pcvr.GetInstance().OpenPlayerStartLed(PlayerSt);
            }
            else
            {
                pcvr.GetInstance().ClosePlayerStartLed(PlayerSt);
            }
        }
    }
Exemplo n.º 5
0
 void DelayStopJiFenPanel()
 {
     if (JiFenJieMianCtrl.GetInstance() != null)
     {
         JiFenJieMianCtrl.GetInstance().StopJiFenTime();
     }
 }
Exemplo n.º 6
0
    void OnTriggerEnter(Collider other)
    {
        if (XKTriggerKaQiuShaFire.IsCloseKaQiuShaTest)
        {
            return;             //test;
        }

        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

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

        XkPlayerCtrl script = other.GetComponent <XkPlayerCtrl>();

        if (script == null || !script.GetIsHandleRpc())
        {
            return;
        }
        PlayerCameraTr  = script.GetPlayerCameraScript().transform;
        IsActiveTrigger = true;
    }
Exemplo n.º 7
0
 void DelayActiveJiFenJieMian()
 {
     if (GameTimeBossCtrl.GetInstance().GetTimeBossResidual() > 0)
     {
         XKGlobalData.GetInstance().PlayAudioBossShengLi();
     }
     JiFenJieMianCtrl.GetInstance().ActiveJiFenJieMian();
 }
Exemplo n.º 8
0
 public void SetParentTran(Transform tran)
 {
     if (GameOverCtrl.IsShowGameOver ||
         (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask()))
     {
         return;
     }
     XkGameCtrl.SetParentTran(transform, tran);
 }
 internal void RemoveSelf()
 {
     if (IsRemoveSelf == false)
     {
         IsRemoveSelf = true;
         Instance     = null;
         Destroy(gameObject);
     }
 }
Exemplo n.º 10
0
 [RPC] void NetCtrlMakeOtherPortStopJiFenTime()
 {
     if (IsMakeGameStopJiFenTime)
     {
         return;
     }
     Debug.Log("Unity:" + "NetCtrlMakeOtherPortStopJiFenTime...");
     IsMakeGameStopJiFenTime = true;
     JiFenJieMianCtrl.GetInstance().StopJiFenTime();
 }
    void HiddenGameOver()
    {
        GameOverObj.SetActive(false);
        //XkGameCtrl.LoadingGameMovie(); //Back Movie Scene.

        if (JiFenJieMianCtrl.GetInstance() != null)
        {
            JiFenJieMianCtrl.GetInstance().ActiveJiFenJieMian();
        }
    }
    public void HandleNpcYouLiangDian(int youLiangDianVal, Transform tranNpc)
    {
        if (JiFenJieMianCtrl.GetInstance() != null)
        {
            if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
            {
                return;
            }
        }

        int randVal = Random.Range(0, 100) % 4;
        int yldLvA  = 4;        //min
        int yldLvB  = 9;        //center

        if (youLiangDianVal <= yldLvA)
        {
            randVal = 0;
        }
        else if (youLiangDianVal > yldLvA && youLiangDianVal <= yldLvB)
        {
            randVal = 1;
        }
        else
        {
            randVal = 2;
        }
        //randVal = 1; //test

        YouLiangDianMoveCtrl scriptYLD = null;

        switch (randVal)
        {
        case 0:
            scriptYLD = XkGameCtrl.GetYLDMoveScript(YouLiangDengJi.Level_1);
            break;

        case 1:
            scriptYLD = XkGameCtrl.GetYLDMoveScript(YouLiangDengJi.Level_2);
            break;

        default:
            scriptYLD = XkGameCtrl.GetYLDMoveScript(YouLiangDengJi.Level_3);
            break;
        }

        Vector3 startPos = Vector3.zero;

        startPos   = Camera.main.WorldToScreenPoint(tranNpc.position);
        startPos.z = 0f;
        startPos.x = (XkGameCtrl.ScreenWidth * startPos.x) / Screen.width;
        startPos.y = (XkGameCtrl.ScreenHeight * startPos.y) / Screen.height;
        //Debug.Log("startPos **** "+startPos);
        scriptYLD.StartMoveYouLiangDian(startPos, YLDEndPosTran.position);
    }
	// Use this for initialization
	void Start()
	{
		Instance = this;
		TimeStartVal = Time.realtimeSinceStartup;
		JiFenZongJieMianObj = gameObject;
		UITexture screenTexture = ScreenDanHeiObj.GetComponent<UITexture>();
		screenTexture.alpha = 0f;
		ScreenDanHeiObj.SetActive(false);
		JiFenZongJieMianObj.SetActive(false);
		JiFenJieMianObj.SetActive(false);
	}
 void SetActiveZuiGaoFen(bool isActive)
 {
     if (isActive)
     {
         if ((JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask()) ||
             JiFenJieMianCtrl.GetInstance() == null)
         {
             isActive = false;
         }
     }
     ZuiGaoFenObj.SetActive(isActive);
 }
    void OnTriggerFireAnimation()
    {
        //return; //test
        //Debug.Log("OnTriggerFireAnimation**NpcName "+AnimatorCom.name);
        if (!XkGameCtrl.IsMoveOnPlayerDeath)
        {
            if (!XkGameCtrl.IsActivePlayerOne && !XkGameCtrl.IsActivePlayerTwo)
            {
                return;
            }
        }

        if ((JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask()) ||
            GameOverCtrl.IsShowGameOver)
        {
            return;
        }

        if (Network.peerType == NetworkPeerType.Client)
        {
            if (!IsDoHuanDanAction)
            {
                StartSpawnNpcAmmo();
                if (CountHuanDan > 0)
                {
                    CountFireAction++;
                    if (CountHuanDan <= CountFireAction)
                    {
                        CountFireAction = 0;
                        PlayNPCHuanDanAction();                         //Play huanDan action}
                    }
                }
            }
            return;
        }

        int rv = AddCountFireAction();

        if (Network.peerType == NetworkPeerType.Server)
        {
            if (XkGameCtrl.CountNpcAmmo >= XkGameCtrl.AmmoNumMaxNpc)
            {
                return;
            }
        }

        if (rv != -1)
        {
            StartSpawnNpcAmmo();
        }
    }
Exemplo n.º 16
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);
    }
Exemplo n.º 17
0
    void OnTriggerEnter(Collider other)
    {
        if (IsDonnotSpawnNpcTest)
        {
            return;             //test.
        }

        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (Network.peerType == NetworkPeerType.Client)
        {
            return;
        }

        XkPlayerCtrl ScriptPlayer = other.GetComponent <XkPlayerCtrl>();

        if (ScriptPlayer == null)
        {
            return;
        }

        if (Time.time - m_LastTriggerTime < 300f)
        {
            //冷却时间.
            return;
        }
        m_LastTriggerTime = Time.time;

        if (XkGameCtrl.GetInstance().IsDisplayBossDeathYanHua == true)
        {
            return;
        }

        //Debug.Log("Unity:"+"XKTriggerSpawnNpc::OnTriggerEnter -> hit "+other.name);
        for (int i = 0; i < SpawnPointArray.Length; i++)
        {
//			if (SpawnPointArray[i].NpcObj.name != TestNpcName || SpawnPointArray[i].NpcFangZhen != null) {
//					continue; //test
//			}
//
//			if (IsDonnotSpawnNpcTest) {
//				return;
//			}
//			IsDonnotSpawnNpcTest = true;
            SpawnPointArray[i].SpawnPointAllNpc();
        }
    }
Exemplo n.º 18
0
    void OnTriggerEnter(Collider other)
    {
        if (IsDonnotSpawnNpcTest)
        {
            return;             //test;
        }

        if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (!XkGameCtrl.IsMoveOnPlayerDeath)
        {
            if (!XkGameCtrl.IsActivePlayerOne && !XkGameCtrl.IsActivePlayerTwo)
            {
                return;
            }
        }

        //if (Network.peerType == NetworkPeerType.Client) {
        //    return;
        //}

        //XkPlayerCtrl ScriptPlayer = other.GetComponent<XkPlayerCtrl>();
        //if (ScriptPlayer == null) {
        //	return;
        //}

        XKXuNiPlayerCtrl ScriptPlayer = other.GetComponent <XKXuNiPlayerCtrl>();

        if (ScriptPlayer == null)
        {
            return;
        }

        //test
        //		if (ScriptPlayer.PlayerSt == PlayerTypeEnum.FeiJi) {
        //			IsDonnotSpawnNpcTest = true;
        //		}
        //		else {
        //			return;
        //		}

        //Debug.Log("XKTriggerSpawnNpc::OnTriggerEnter -> hit "+other.name);
        for (int i = 0; i < SpawnPointArray.Length; i++)
        {
            SpawnPointArray[i].SpawnPointAllNpc();
        }
    }
Exemplo n.º 19
0
    void OnClickTiaoGuoBt()
    {
        XKGlobalData.GetInstance().PlayStartBtAudio();
        HiddenTiaoGuoBt();
        if (!JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            if (Network.peerType != NetworkPeerType.Server)
            {
                XKTriggerEndCartoon.GetInstance().CloseStartCartoon();
            }
        }

        /*else {
         *      JiFenJieMianCtrl.GetInstance().StopJiFenTime();
         * }*/
    }
 void SetActiveZuiGaoFen(bool isActive)
 {
     if (isActive)
     {
         //if ((JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
         //    || JiFenJieMianCtrl.GetInstance() == null) {
         if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
         {
             isActive = false;
         }
         else if (gameObject.activeInHierarchy == false)
         {
             isActive = false;
         }
     }
     ZuiGaoFenObj.SetActive(isActive);
 }
Exemplo n.º 21
0
    void ChangeDaoJiShiVal()
    {
        if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            StopDaoJiShi();
            return;
        }

        if (DaoJiShiCount <= 1)
        {
            StopDaoJiShi();
            GameOverCtrl.GetInstance().ShowGameOver();
            return;
        }

        DaoJiShiCount--;
        DaoJiShiSprite.spriteName = "daoJiShi" + DaoJiShiCount;
        ShowDaoJiShiInfo();
    }
Exemplo n.º 22
0
    void Update()
    {
        if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            if (InsertCoinObj.activeSelf)
            {
                InsertCoinObj.SetActive(false);
            }

            if (StartBtObj.activeSelf)
            {
                StartBtObj.SetActive(false);
            }
            return;
        }

        CheckPlayerOneCoinCur();
        CheckPlayerTwoCoinCur();
    }
    void OnTriggerEnter(Collider other)
    {
        if (IsDonnotSpawnNpcTest)
        {
            return;             //test.
        }

        if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (Network.peerType == NetworkPeerType.Client)
        {
            return;
        }

        XkPlayerCtrl ScriptPlayer = other.GetComponent <XkPlayerCtrl>();

        if (ScriptPlayer == null)
        {
            return;
        }

        if (Time.time - m_LastTriggerTime < 300f)
        {
            //冷却时间.
            return;
        }
        m_LastTriggerTime = Time.time;

        if (XkGameCtrl.GetInstance().IsDisplayBossDeathYanHua == true)
        {
            return;
        }

        StartCoroutine(DelayCreateNpc());
        //Debug.Log("Unity:"+"XKTriggerSpawnNpc::OnTriggerEnter -> hit "+other.name);
        //for (int i = 0; i < SpawnPointArray.Length; i++) {
        //	SpawnPointArray[i].SpawnPointAllNpc();
        //}
    }
    void Update()
    {
        if ((JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask()) ||
            (PlayerSt == PlayerEnum.PlayerOne && XkGameCtrl.IsActivePlayerOne) ||
            (PlayerSt == PlayerEnum.PlayerTwo && XkGameCtrl.IsActivePlayerTwo))
        {
            if (InsertCoinObj.activeSelf)
            {
                InsertCoinObj.SetActive(false);
            }

            if (StartBtObj.activeSelf)
            {
                StartBtObj.SetActive(false);
            }
            return;
        }

        CheckPlayerOneCoinCur();
        CheckPlayerTwoCoinCur();
    }
    void OnTriggerEnter(Collider other)
    {
        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

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

        XkPlayerCtrl playerScript = other.GetComponent <XkPlayerCtrl>();

        if (playerScript == null || !playerScript.GetIsHandleRpc())
        {
            return;
        }
        gameObject.SetActive(false);
        XkGameCtrl.GetInstance().SetIsStopMovePlayer(false);
        XkGameCtrl.GetInstance().SetIsActiveWuDiState(true);
    }
Exemplo n.º 26
0
    void ChangeDaoJiShiVal()
    {
        m_TimeLastChange     = Time.time;
        IsOpenChangeDaoJiShi = false;
        if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            StopDaoJiShi();
            return;
        }

        if (DaoJiShiCount <= 1)
        {
            StopDaoJiShi();
            ShowGameOverObj();
//			if (XkGameCtrl.PlayerActiveNum <= 0 && CountDaoJiShi > 0) {
//				Debug.LogWarning("Unity:"+"ChangeDaoJiShiVal -> CountDaoJiShi "+CountDaoJiShi);
//			}

            //玩家没有进行续币.
            //重置玩家续币信息.
            XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.ResetPlayerXuBiInfo(PlayerIndex);
            //if (XkGameCtrl.PlayerActiveNum <= 0 && CountDaoJiShi <= 0) {
            //	GameOverCtrl.GetInstance().ShowGameOver();
            //}

            XkGameCtrl.GetInstance().ResetPlayerInfo(PlayerIndex);

            if (XKGlobalData.GetInstance().m_SSGameXuMingData != null)
            {
                //如果当前机位游戏续命倒计时结束之后就清除续命计数信息.
                XKGlobalData.GetInstance().m_SSGameXuMingData.ResetXuMingCount(PlayerIndex);
            }
            return;
        }

        DaoJiShiCount--;
        DaoJiShiSprite.spriteName = "daoJiShi" + DaoJiShiCount;
        ShowDaoJiShiInfo();
    }
    public static void ShowDongGanInfo(PlayerEnum playerIndex)
    {
        if (!ScreenDanHeiCtrl.IsStartGame)
        {
            return;
        }

        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        DongGanUICtrl instanceDG = null;

        switch (playerIndex)
        {
        case PlayerEnum.PlayerOne:
            instanceDG = InstanceOne;
            break;

        case PlayerEnum.PlayerTwo:
            instanceDG = InstanceTwo;
            break;

        case PlayerEnum.PlayerThree:
            instanceDG = InstanceThree;
            break;

        case PlayerEnum.PlayerFour:
            instanceDG = InstanceFour;
            break;
        }

        if (instanceDG == null)
        {
            return;
        }
        instanceDG.AddDongGanCount();
    }
    void OnTriggerEnter(Collider other)
    {
        if (JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (!XkGameCtrl.IsMoveOnPlayerDeath)
        {
            if (!XkGameCtrl.IsActivePlayerOne && !XkGameCtrl.IsActivePlayerTwo)
            {
                return;
            }
        }

        XkPlayerCtrl ScriptPlayer = XkGameCtrl.GetPlayerScript(other.gameObject);

        if (ScriptPlayer == null)
        {
            return;
        }
        CheckAutoFireCom();
    }
    void ChangeDaoJiShiVal()
    {
        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            StopDaoJiShi();
            return;
        }

        if (DaoJiShiCount <= 1)
        {
            StopDaoJiShi();
            GameOverCtrl.GetInstance().ShowGameOver();
            return;
        }

        DaoJiShiCount--;
        DaoJiShiSprite.spriteName = "daoJiShi" + DaoJiShiCount;
        ShowDaoJiShiInfo();

        if (!pcvr.bIsHardWare && DaoJiShiCount == 1 && IsTestActivePlayer)
        {
            XkGameCtrl.SetActivePlayerOne(true);
        }
    }
    void OnTriggerFireAnimation()
    {
        //return; //test
        //Debug.Log("Unity:"+"OnTriggerFireAnimation**NpcName "+AnimatorCom.name);
        if (!XkGameCtrl.IsMoveOnPlayerDeath)
        {
            if (!XkGameCtrl.IsActivePlayerOne && !XkGameCtrl.IsActivePlayerTwo)
            {
                return;
            }
        }

        if ((JiFenJieMianCtrl.GetInstance() != null && JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask()) ||
            GameOverCtrl.IsShowGameOver)
        {
            return;
        }

        if (XkGameCtrl.GetInstance().IsCreatAmmoOnBoss == false)
        {
            if (XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.GetIsHaveCaiPiaoBoss() == true &&
                Random.Range(0, 100) % 2 == 0)
            {
                //有彩票boss产生,不再继续发射子弹.
                return;
            }
        }

        //Debug.Log("************************11111 time " + Time.time);
        int rv = AddCountFireAction();

        if (rv != -1)
        {
            StartSpawnNpcAmmo();
        }
    }