Ejemplo n.º 1
0
    public List <TDS_SpawningInformation> GetSpawnInformations()
    {
        List <TDS_SpawningInformation> _informations = new List <TDS_SpawningInformation>();

        _informations.AddRange(staticWaveElement.GetInformations(position, range));
        _informations.AddRange(randomWaveElement.GetInformations(position, range));
        return(_informations);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Get all enemies resources Names
    /// Instantiate them and set their owner as the spawner area that owns this SpawnPoint
    /// return the list of all spawned enemies
    /// </summary>
    /// <param name="_owner">TDS_SpawnerArea that owns the spawn point</param>
    /// <returns>List of spawned enemies</returns>
    public List <TDS_Enemy> GetSpawningEnemies(TDS_SpawnerArea _owner)
    {
        // Get enemies from the wave Element
        List <string> _enemiesNames = waveElement.GetInformations();
        //Create the list of spawned Enemies for this spawn point
        List <TDS_Enemy> _spawnedEnemies = new List <TDS_Enemy>();
        // Spawn every enemies from thoses informations
        TDS_Enemy _e;

        for (int i = 0; i < _enemiesNames.Count; i++)
        {
            _e      = PhotonNetwork.Instantiate(_enemiesNames[i], GetRandomSpawnPosition(), Quaternion.identity, 0).GetComponent <TDS_Enemy>();
            _e.Area = _owner;
            _spawnedEnemies.Add(_e);
        }
        return(_spawnedEnemies);
    }