コード例 #1
0
ファイル: PlayerTank.cs プロジェクト: HyVong007/BattleCity
        public override void Explode()
        {
            // anim big explosion
            // sound player explosion
            // Nếu là human thì rung tay cầm

            isExploded = true;
            gameObject.SetActive(false);
            star = Setting.defaultPlayerStar;
            if (lifes[color] != 0)
            {
                Spawn(color, false).Forget();
                return;
            }

            foreach (int life in lifes.Values)
            {
                if (life != 0)
                {
                    if (PlayerAgent.colors.Contains(color))
                    {
                        PlayerAgent.DecideBorrowingLife(color);
                    }
                    return;
                }
            }

            foreach (var player in players.Values)
            {
                if (player.enabled)
                {
                    return;
                }
            }
            BattleField.instance.Finish();
        }