Infinite Runner Engine v1.9
|
Spawns and positions/resizes objects based on the distance traveled More...
Public Types | |
enum | GapOrigins { Spawner , LastSpawnedObject } |
Public Attributes | |
GapOrigins | GapOrigin = GapOrigins.Spawner |
is the gap related to the last object or the spawner ? More... | |
Vector3 | MinimumGap = new Vector3(1,1,1) |
the minimum gap bewteen two spawned objects More... | |
Vector3 | MaximumGap = new Vector3(1,1,1) |
the maximum gap between two spawned objects More... | |
float | MinimumYClamp |
the minimum Y position we can spawn the object at More... | |
float | MaximumYClamp |
the maximum Y position we can spawn the object at More... | |
float | MinimumZClamp |
the minimum Z position we can spawn the object at More... | |
float | MaximumZClamp |
the maximum Z position we can spawn the object at More... | |
bool | SpawnRotatedToDirection =true |
if true, the spawned objects will be rotated towards the spawn direction 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 () |
Triggered at the start of the level, initialization More... | |
virtual void | Update () |
Triggered every frame More... | |
virtual void | CheckSpawn () |
Checks if the conditions for a new spawn are met, and if so, triggers the spawn of a new object More... | |
virtual void | DistanceSpawn (Vector3 spawnPosition) |
Spawns an object at the specified position and determines the next spawn position More... | |
virtual Vector3 | ClampedPosition (Vector3 vectorToClamp) |
Returns a Vector3 clamped on the Y and Z axis based on the inspector settings More... | |
virtual Vector3 | ClampedPositionRelative (Vector3 vectorToClamp, Vector3 clampOrigin) |
Returns a Vector3 clamped on the Y and Z axis based on the inspector settings More... | |
virtual void | OnDrawGizmosSelected () |
Draws on the scene view cubes to show the minimum and maximum gaps, for tweaking purposes. More... | |
virtual void | DrawClamps () |
Draws the position clamps, called when the object is selected in scene view More... | |
Protected Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Spawner | |
virtual void | Awake () |
On awake, we get the objectPooler component More... | |
Protected Attributes | |
Transform | _lastSpawnedTransform |
float | _nextSpawnDistance |
Vector3 | _gap = Vector3.zero |
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... | |
Spawns and positions/resizes objects based on the distance traveled
|
protectedvirtual |
Checks if the conditions for a new spawn are met, and if so, triggers the spawn of a new object
|
protectedvirtual |
Returns a Vector3 clamped on the Y and Z axis based on the inspector settings
vectorToClamp | Vector to clamp. |
|
protectedvirtual |
Returns a Vector3 clamped on the Y and Z axis based on the inspector settings
vectorToClamp | Vector to clamp. |
|
protectedvirtual |
Spawns an object at the specified position and determines the next spawn position
spawnPosition | Spawn position. |
|
protectedvirtual |
Draws the position clamps, called when the object is selected in scene view
|
protectedvirtual |
Draws on the scene view cubes to show the minimum and maximum gaps, for tweaking purposes.
|
protectedvirtual |
Triggered at the start of the level, initialization
we get the object pooler component
|
protectedvirtual |
Triggered every frame
|
protected |
|
protected |
|
protected |
GapOrigins MoreMountains.InfiniteRunnerEngine.DistanceSpawner.GapOrigin = GapOrigins.Spawner |
is the gap related to the last object or the spawner ?
Vector3 MoreMountains.InfiniteRunnerEngine.DistanceSpawner.MaximumGap = new Vector3(1,1,1) |
the maximum gap between two spawned objects
float MoreMountains.InfiniteRunnerEngine.DistanceSpawner.MaximumYClamp |
the maximum Y position we can spawn the object at
float MoreMountains.InfiniteRunnerEngine.DistanceSpawner.MaximumZClamp |
the maximum Z position we can spawn the object at
Vector3 MoreMountains.InfiniteRunnerEngine.DistanceSpawner.MinimumGap = new Vector3(1,1,1) |
the minimum gap bewteen two spawned objects
float MoreMountains.InfiniteRunnerEngine.DistanceSpawner.MinimumYClamp |
the minimum Y position we can spawn the object at
float MoreMountains.InfiniteRunnerEngine.DistanceSpawner.MinimumZClamp |
the minimum Z position we can spawn the object at
bool MoreMountains.InfiniteRunnerEngine.DistanceSpawner.SpawnRotatedToDirection =true |
if true, the spawned objects will be rotated towards the spawn direction