Example #1
0
 /// <summary>
 /// 游戏状态转换方法
 /// </summary>
 /// <param name="state"></param>
 public void ChangeGameState(GameState state)
 {
     //存储传递过来的状态
     gameState = state;
     if (gameState == GameState.GAME)
     {
         mGameUI.SetActive(true);
         mEndUI.SetActive(false);
         //生成场内角色及物品
         //怪物
         mEnemyManager.StartCreateEnemy();
         //急救包
         mLPSManager.StartCreatePrefab();
         //子弹补给
         mBBSManager.StartCreatePrefab();
         //人物血量
         mPlayer.RemoveDamage();
         //初始化背包
         mBackpack.Remove();
         //同步ui
         LNUpdate(mBackpack.lPNum.ToString());
         BNUpdate(mBackpack.bNum.ToString());
         PosUpdate02();
         StartCompute();
     }
     else if (gameState == GameState.END)
     {
         mGameUI.SetActive(false);
         mEndUI.SetActive(true);
         mEnemyManager.StopCreateEnemy();
         mEnemyManager.RemoveEnemy();
         mLPSManager.RemoveLP();
         mBBSManager.StopCreatePrefab();
         mBBSManager.RemovePrefab();
     }
 }