Beispiel #1
0
        /// <summary>
        /// Find a random spawner node in this network which doesn't have a spawned entity alive.
        /// </summary>
        /// <returns>A SpawnerComponent without a spawn if available, otherwise null.</returns>
        public SpawnerComponent FindInactiveNode()
        {
            var availableNodes = SpawnerNodes.Where(node =>
                                                    node.HasActiveSpawn == false).ToArray();

            // All spawner nodes are in use
            if (availableNodes.Length == 0)
            {
                return(default);
Beispiel #2
0
 /// <summary>
 /// Add a new spawner node to this network.
 /// </summary>
 /// <param name="component">Spawner component to add.</param>
 public void AddSpawnerNode(SpawnerComponent component)
 {
     SpawnerNodes.Add(component);
 }