Exemplo n.º 1
0
        /// <summary>
        /// Tries to setup the next spawn
        /// </summary>
        /// <returns>true if there is another spawn instruction, false if not</returns>
        protected bool TrySetupNextSpawn()
        {
            bool hasNext = spawnInstructions.Next(ref m_CurrentIndex);

            if (hasNext)
            {
                SpawnInstruction nextSpawnInstruction = spawnInstructions[m_CurrentIndex];
                if (nextSpawnInstruction.delayToSpawn <= 0f)
                {
                    SpawnCurrent();
                }
                else
                {
                    m_SpawnTimer.SetTime(nextSpawnInstruction.delayToSpawn);
                }
            }

            return(hasNext);
        }
Exemplo n.º 2
0
        protected void Spawn()
        {
            SpawnInstruction spawnInstruction = spawnInstructions[m_CurrentIndex];

            SpawnEnemy(spawnInstruction.agentConfiguration, spawnInstruction.startingNode);
        }