Difference between revisions of "SpawnBehavior"
(Initial page, includes API information and categories) |
(Initial page, includes API information and categories) |
||
Line 8: | Line 8: | ||
=== maxSpawns : int === | === maxSpawns : int === | ||
This is the maximum number of prefabs to spawn. | This is the maximum number of prefabs to spawn. | ||
− | + | === spawnDelay : float === | |
− | + | This is how many seconds to wait between spawning prefabs. | |
− | + | === spawnRange : float === | |
− | + | How close the player must be before the object will be spawned. Set to -1 for infinite range. | |
− | + | === targetTag : string === | |
− | + | This is the tag of the player object. If set and '''target''' is null when the scene starts, the first object found with this tag will be used. | |
− | + | === target : GameObject === | |
− | + | This is the object that must be in range before objects will be spawned, if '''spawnRange''' is greater than 0. | |
− | + | === spawnWarningPrefab : GameObject === | |
− | + | This is an object that will be spawned for a short time before the actual prefab is spawned. | |
− | + | === spawnWarningTime : float === | |
− | + | This is how long (in seconds) to leave the spawn warning object alive. | |
[[Category:API]] | [[Category:API]] | ||
[[Category:Premium Scripts]] | [[Category:Premium Scripts]] | ||
[[Category:Utility]] | [[Category:Utility]] |
Latest revision as of 03:35, 21 April 2013
This script is used to spawn objects into the scene repeatedly. It also supports showing a warning object in the scene before the actual object is spawned.
Contents |
[edit] Public Variables
[edit] prefabToSpawn : GameObject
This should be set in the editor to a prefab that will be spawned into the scene.
[edit] theParent : Transform
This is optional - if set, the objects that are spawned will set this as their parent.
[edit] maxSpawns : int
This is the maximum number of prefabs to spawn.
[edit] spawnDelay : float
This is how many seconds to wait between spawning prefabs.
[edit] spawnRange : float
How close the player must be before the object will be spawned. Set to -1 for infinite range.
[edit] targetTag : string
This is the tag of the player object. If set and target is null when the scene starts, the first object found with this tag will be used.
[edit] target : GameObject
This is the object that must be in range before objects will be spawned, if spawnRange is greater than 0.
[edit] spawnWarningPrefab : GameObject
This is an object that will be spawned for a short time before the actual prefab is spawned.
[edit] spawnWarningTime : float
This is how long (in seconds) to leave the spawn warning object alive.