Pro Pooling
ProPooling.Spawner Class Reference

Component for automatically spawning items from the Global Pools. More...

Inheritance diagram for ProPooling.Spawner:

Classes

class  SpawnableLocation
 Class for the locations where spawning can occur. More...
 
class  SpawnablePrefab
 Class for the prefabs that can be spawned. More...
 

Public Types

enum  SpawnFromEnum { SpawnFromEnum.GlobalPools, SpawnFromEnum.PoolsComponent, SpawnFromEnum.Instantiate }
 
enum  AutomaticallyRunEnum { AutomaticallyRunEnum.Never, AutomaticallyRunEnum.OnStart }
 
enum  RunPeriodEnum { RunPeriodEnum.Forever, RunPeriodEnum.GivenNumberOfSeconds, RunPeriodEnum.GivenNumberOfTimes }
 How long to run the spawning for. More...
 
enum  SpawnIntervalModeEnum { SpawnIntervalModeEnum.Constant, SpawnIntervalModeEnum.RandomBetweenTwoConstants }
 What spawn interval to use More...
 
enum  ScaleModeEnum {
  ScaleModeEnum.FromPrefab, ScaleModeEnum.Constant, ScaleModeEnum.ConstantMultiplier, ScaleModeEnum.RandomBetweenTwoConstants,
  ScaleModeEnum.RandomBetweenTwoConstantsMultiplier
}
 How to scale spawned prefabs More...
 
enum  RotationModeEnum { RotationModeEnum.FromPrefab, RotationModeEnum.Constant, RotationModeEnum.RandomBetweenTwoConstants }
 How to rotate spawned prefabs More...
 
enum  SelectionMode { SelectionMode.InOrder, SelectionMode.Random, SelectionMode.RandomWeighted }
 How to select prefabs and locations More...
 
enum  LocationTypeEnum { LocationTypeEnum.SpawnersLocation, LocationTypeEnum.SpecifiedLocations, LocationTypeEnum.FromTransforms }
 Where to spawn More...
 

Public Member Functions

void StartSpawning ()
 Start spawning items according to the current settings. More...
 
void StopSpawning ()
 Stop spawning. More...
 
void RestartSpawning ()
 Restart the spawning from the beginning. More...
 
void PauseSpawning ()
 Pause spawning. Note any running start delay / spawn wait intervals will still complete for performance reasons. More...
 
void ResumeSpawning ()
 Resume spawning. Note any running start delay / spawn wait intervals will still complete for performance reasons. More...
 
void UpdateCachedValues ()
 Update any cached values to reflect changes. More...
 
void SpawnOnce ()
 Spawn a new item immediately. More...
 
bool ValidateConfiguration ()
 Check if the current configuration is valid for spawning and warn if not. More...
 

Properties

SpawnFromEnum SpawnFrom [get, set]
 When to spawn items from More...
 
Pools SpawnPools [get, set]
 If Spawn From is set to PoolsComponent then a reference to teh component to use. More...
 
AutomaticallyRunEnum AutomaticallyRun [get, set]
 When to automatically start spawning More...
 
float Delay [get, set]
 An optional delay before starting spawning More...
 
RunPeriodEnum RunPeriod [get, set]
 How long to spawn for More...
 
int SpawnCount [get, set]
 The number of instances to spawn if using RunModeEnum.Count More...
 
float SpawnTime [get, set]
 The time in seconds to spawn items for if using RunModeEnum.Time More...
 
SpawnIntervalModeEnum SpawnIntervalMode [get, set]
 Now to determine the time interval between spawning new items More...
 
float SpawnInterval [get, set]
 The time interval between spawning new items More...
 
float MinimumSpawnInterval [get, set]
 The minimum time interval between spawning new items if using a random interval between two constants More...
 
float MaximumSpawnInterval [get, set]
 The maximum time interval between spawning new items if using a random interval between two constants More...
 
ScaleModeEnum ScaleMode [get, set]
 The scale mode to use for spawned items More...
 
Vector3 Scale [get, set]
 The scale to use for spawned items if using a constant scale or multiplier More...
 
Vector3 MinimumScale [get, set]
 The minimum scale to use for spawned items if using a random scale or multiplier between two constants More...
 
RotationModeEnum RotationMode [get, set]
 The rotation mode to use for spawned items More...
 
Vector3 Rotation [get, set]
 The rotation to use for spawned items if using a constant rotation or multiplier More...
 
Vector3 MinimumRotation [get, set]
 The minimum rotation to use for spawned items if using a random rotation or multiplier between two constants More...
 
SelectionMode SelectPrefab [get, set]
 How to select the prefab to spawn More...
 
List< SpawnablePrefabSpawnablePrefabs [get, set]
 The prefab sto Spawn More...
 
LocationTypeEnum LocationType [get, set]
 What type of location to use for spawning More...
 
SelectionMode SelectLocation [get, set]
 How to select the locations to spawn More...
 
List< SpawnableLocationSpawnLocations [get, set]
 The locations where to spawn More...
 

Detailed Description

Component for automatically spawning items from the Global Pools.

Member Enumeration Documentation

◆ AutomaticallyRunEnum

Enumerator
Never 

Don't automatically spawn - start spawning through code or an event hooked up to the StartSpawning method.

OnStart 

Start spawning automatically in the Start method.

◆ LocationTypeEnum

Where to spawn

Enumerator
SpawnersLocation 

Spawn from the spawners location

SpecifiedLocations 

Spawn from specified locations

FromTransforms 

Spawn from the locations held be specified transforms.

◆ RotationModeEnum

How to rotate spawned prefabs

Enumerator
FromPrefab 

Use the rotation defined on the prefab

Constant 

Use a constant rotation

RandomBetweenTwoConstants 

Use a random rotation between two constants

◆ RunPeriodEnum

How long to run the spawning for.

Enumerator
Forever 

Spawn forever unless manually stopped.

GivenNumberOfSeconds 

Sparn until the specified time is over.

GivenNumberOfTimes 

Start the specified number of instances.

◆ ScaleModeEnum

How to scale spawned prefabs

Enumerator
FromPrefab 

Use the scale defined on the prefab

Constant 

Use a constant scale

ConstantMultiplier 

Use a constant multiplier on the prefabs scale

RandomBetweenTwoConstants 

Use a random scale between two constants

RandomBetweenTwoConstantsMultiplier 

Use a random multiplier between two constants on the prefabs scale

◆ SelectionMode

How to select prefabs and locations

Enumerator
InOrder 

Select tone after the other in order

Random 

Select at random

RandomWeighted 

Select at random using specified weights.

◆ SpawnFromEnum

Enumerator
GlobalPools 

Spawn from the GlobalPools

PoolsComponent 

Spawn from a Pools component

Instantiate 

Instantiate items on the fly (avoid using this).

◆ SpawnIntervalModeEnum

What spawn interval to use

Enumerator
Constant 

Use a constant spawn interval

RandomBetweenTwoConstants 

Use a random interval between two constants

Member Function Documentation

◆ PauseSpawning()

void ProPooling.Spawner.PauseSpawning ( )

Pause spawning. Note any running start delay / spawn wait intervals will still complete for performance reasons.

◆ RestartSpawning()

void ProPooling.Spawner.RestartSpawning ( )

Restart the spawning from the beginning.

◆ ResumeSpawning()

void ProPooling.Spawner.ResumeSpawning ( )

Resume spawning. Note any running start delay / spawn wait intervals will still complete for performance reasons.

◆ SpawnOnce()

void ProPooling.Spawner.SpawnOnce ( )

Spawn a new item immediately.

This might update next spawn location, next prefab etc. But won't affect any spawn counters

◆ StartSpawning()

void ProPooling.Spawner.StartSpawning ( )

Start spawning items according to the current settings.

◆ StopSpawning()

void ProPooling.Spawner.StopSpawning ( )

Stop spawning.

◆ UpdateCachedValues()

void ProPooling.Spawner.UpdateCachedValues ( )

Update any cached values to reflect changes.

Pro Pooling caches several values for performance reasons. Be sure to call this if you make any changes to the properties. Note that this method does not do full validation or warn on issues with the state.

◆ ValidateConfiguration()

bool ProPooling.Spawner.ValidateConfiguration ( )

Check if the current configuration is valid for spawning and warn if not.

Property Documentation

◆ AutomaticallyRun

AutomaticallyRunEnum ProPooling.Spawner.AutomaticallyRun
getset

When to automatically start spawning

◆ Delay

float ProPooling.Spawner.Delay
getset

An optional delay before starting spawning

◆ LocationType

LocationTypeEnum ProPooling.Spawner.LocationType
getset

What type of location to use for spawning

◆ MaximumSpawnInterval

float ProPooling.Spawner.MaximumSpawnInterval
getset

The maximum time interval between spawning new items if using a random interval between two constants

◆ MinimumRotation

Vector3 ProPooling.Spawner.MinimumRotation
getset

The minimum rotation to use for spawned items if using a random rotation or multiplier between two constants

◆ MinimumScale

Vector3 ProPooling.Spawner.MinimumScale
getset

The minimum scale to use for spawned items if using a random scale or multiplier between two constants

◆ MinimumSpawnInterval

float ProPooling.Spawner.MinimumSpawnInterval
getset

The minimum time interval between spawning new items if using a random interval between two constants

◆ Rotation

Vector3 ProPooling.Spawner.Rotation
getset

The rotation to use for spawned items if using a constant rotation or multiplier

◆ RotationMode

RotationModeEnum ProPooling.Spawner.RotationMode
getset

The rotation mode to use for spawned items

◆ RunPeriod

RunPeriodEnum ProPooling.Spawner.RunPeriod
getset

How long to spawn for

◆ Scale

Vector3 ProPooling.Spawner.Scale
getset

The scale to use for spawned items if using a constant scale or multiplier

◆ ScaleMode

ScaleModeEnum ProPooling.Spawner.ScaleMode
getset

The scale mode to use for spawned items

◆ SelectLocation

SelectionMode ProPooling.Spawner.SelectLocation
getset

How to select the locations to spawn

◆ SelectPrefab

SelectionMode ProPooling.Spawner.SelectPrefab
getset

How to select the prefab to spawn

◆ SpawnablePrefabs

List<SpawnablePrefab> ProPooling.Spawner.SpawnablePrefabs
getset

The prefab sto Spawn

◆ SpawnCount

int ProPooling.Spawner.SpawnCount
getset

The number of instances to spawn if using RunModeEnum.Count

◆ SpawnFrom

SpawnFromEnum ProPooling.Spawner.SpawnFrom
getset

When to spawn items from

◆ SpawnInterval

float ProPooling.Spawner.SpawnInterval
getset

The time interval between spawning new items

◆ SpawnIntervalMode

SpawnIntervalModeEnum ProPooling.Spawner.SpawnIntervalMode
getset

Now to determine the time interval between spawning new items

◆ SpawnLocations

List<SpawnableLocation> ProPooling.Spawner.SpawnLocations
getset

The locations where to spawn

◆ SpawnPools

Pools ProPooling.Spawner.SpawnPools
getset

If Spawn From is set to PoolsComponent then a reference to teh component to use.

◆ SpawnTime

float ProPooling.Spawner.SpawnTime
getset

The time in seconds to spawn items for if using RunModeEnum.Time


The documentation for this class was generated from the following file: