示例#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);
        }
示例#2
0
        /// <summary>
        /// Spawns the current agent
        /// </summary>
        protected void Spawn()
        {
            SpawnInstruction spawnInstruction = spawnInstructions[m_CurrentIndex];

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