|
Infinite Runner Engine
v2.1
|
This spawns an object at random intervals within the specified bounds. More...
Public Attributes | |
| float | MinSpawnTime = 0.5f |
| the minimum interval (in seconds) between 2 spawns More... | |
| float | MaxSpawnTime = 2f |
| the maximum interval (in seconds) between 2 spawns More... | |
| Vector3 | MinPosition |
| the minimum position of the object More... | |
| Vector3 | MaxPosition |
| the maximum position of the object More... | |
Public Attributes inherited from MoreMountains.InfiniteRunnerEngine.Spawner | |
| Vector3 | MinimumSize = new Vector3(1, 1, 1) |
| the minimum size of a spawned object More... | |
| Vector3 | MaximumSize = new Vector3(1, 1, 1) |
| the maximum size of a spawned object More... | |
| bool | PreserveRatio = false |
| if set to true, the random size will preserve the original's aspect ratio More... | |
| Vector3 | MinimumRotation |
| the minimum size of a spawned object More... | |
| Vector3 | MaximumRotation |
| the maximum size of a spawned object More... | |
| bool | Spawning = true |
| if true, the spawner can spawn, if not, it won't spawn More... | |
| bool | OnlySpawnWhileGameInProgress = true |
| if true, only spawn objects while the game is in progress More... | |
| float | InitialDelay = 0f |
| Initial delay before the first spawn, in seconds. More... | |
Protected Member Functions | |
| virtual void | Start () |
| On start, we store the objectPooler component and schedule the first spawn More... | |
| virtual void | Update () |
| On update, we check if we should spawn or not More... | |
| virtual void | TimeSpawn () |
| Spawns and positions an object, and schedules the next spawn More... | |
| virtual float | RandomDuration () |
| Returns a new random duration based on min and max spawn times More... | |
Protected Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Spawner | |
| virtual void | Awake () |
| On awake, we get the objectPooler component More... | |
Protected Attributes | |
| float | _timeUntilNextSpawn = 0f |
| float | _timeSinceLastSpawn = 0f |
Protected Attributes inherited from MoreMountains.InfiniteRunnerEngine.Spawner | |
| MMObjectPooler | _objectPooler |
| float | _startTime |
Additional Inherited Members | |
Public Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Spawner | |
| virtual GameObject | Spawn (Vector3 spawnPosition, bool triggerObjectActivation=true) |
| Spawns a new object and positions/resizes it More... | |
This spawns an object at random intervals within the specified bounds.
|
protectedvirtual |
Returns a new random duration based on min and max spawn times
|
protectedvirtual |
On start, we store the objectPooler component and schedule the first spawn
|
protectedvirtual |
Spawns and positions an object, and schedules the next spawn
|
protectedvirtual |
On update, we check if we should spawn or not
|
protected |
|
protected |
| Vector3 MoreMountains.InfiniteRunnerEngine.TimedSpawner.MaxPosition |
the maximum position of the object
| float MoreMountains.InfiniteRunnerEngine.TimedSpawner.MaxSpawnTime = 2f |
the maximum interval (in seconds) between 2 spawns
| Vector3 MoreMountains.InfiniteRunnerEngine.TimedSpawner.MinPosition |
the minimum position of the object
| float MoreMountains.InfiniteRunnerEngine.TimedSpawner.MinSpawnTime = 0.5f |
the minimum interval (in seconds) between 2 spawns