Exemplo n.º 1
0
        private void SpawnColumn(Transform[] spawnPointColumn, int columnIndex)
        {
            for (int rowIndex = 0; rowIndex < spawnPointColumn.Length; rowIndex++)
            {
                Transform  spawnPoint = spawnPointColumn[rowIndex];
                EnemyAgent agent      = _fleetModel[columnIndex][rowIndex];
                if (agent == null)
                {
                    agent = _container.Instantiate <EnemyAgent>();
                    _fleetModel[columnIndex][rowIndex] = agent;
                    agent.SetFleetCoordinate(columnIndex, rowIndex);
                }

                agent.Reset();
                _shipFactory.Create(spawnPoint,
                                    agent,    // IShipPilot
                                    agent);   // IShipGunner
                if (rowIndex == 0)
                {
                    agent.FireAtWill();
                }
            }
        }