Exemplo n.º 1
0
        private async void Start()
        {
            Platform.ImportCurrentStage();
            await UniTask.Yield();

            foreach (var color in humanPlayerColors)
            {
                Gamepad.GetInstance(color).Add(gamepadListeners[color] = new GamepadListener(color));
            }


            // spawn enemy
            EnemyTank.lifes[EnemyTank.Type.Big] = 1;
            EnemyAgent.SpawnTank().Forget();



            // spawn player
            PlayerTank.lifes[Tank.Color.Yellow] = 1;            // Test
            PlayerTank.lifes[Tank.Color.Green]  = 1;            // Test

            if (aiPlayerColors.Length != 0)
            {
                "Player Agent".Instantiate(transform);
            }
            foreach (var color in humanPlayerColors)
            {
                PlayerTank.Spawn(color, false).Forget();
            }
            foreach (var color in aiPlayerColors)
            {
                PlayerTank.Spawn(color, false).Forget();
            }
        }
Exemplo n.º 2
0
        public override void Explode()
        {
            // anim big explosion
            // sound enemy explosion

            pool.Recycle(this);
            foreach (int life in lifes.Values)
            {
                if (life != 0)
                {
                    EnemyAgent.SpawnTank().Forget();
                    return;
                }
            }

            if (pool.usingCount == 0)
            {
                // remove sound enemy exist
                BattleField.instance.Finish();
            }
        }