C# Class MBAnchor, Pharos

Class to create visible hierarchies and emitter pooling within Magical Box
Though any GameObject can be used to group emitters (as long as it's inside a ParticleSystem's child hierarchy), Anchors are shown in the editor window and draw their own gizmo icon. They also include pooling manager capabilities for easy emitter pooling
Inheritance: MBObject
Afficher le fichier Open project: rstaewen/Pharos Class Usage Examples

Méthodes publiques

Свойство Type Description
AllocationBlockSize int
AutoCull bool
AutoDespawn bool
CullingSpeed float
MaxPoolSize int
MinPoolSize int
OnMaxPoolSize MBAnchorPoolExceededMode
PoolingEnabled bool

Méthodes publiques

Méthode Description
ClearPool ( ) : void

Remove all instances held by the pool

Cull ( ) : void

Shrink the stock to match MaxPoolSize

Cull ( bool smartCull ) : void

Shrink the stock to match MaxPoolSize

Despawn ( MBEmitter item ) : void

Despawn an item and add it back to the stock

DespawnAll ( ) : void

Despawn all items currently spawned from this pool

IsManaged ( MBEmitter item ) : bool

Whether an item is managed by this pool

IsSpawned ( MBEmitter item ) : bool

Whether an item is spawned by this pool

LateUpdate ( ) : void
Populate ( int no ) : void

Create instances and add them to the stock

PreparePool ( ) : void

Clear all instances and repopulate the pool to match MinPoolSize

Spawn ( ) : MBEmitter

Spawn an instance, make it active and add it to the Spawned list

callbackAutoDespawn ( MBEvent, e ) : void

Private Methods

Méthode Description
AddEmitter ( ) : MBEmitter
AddEmitter ( MBEmitter source ) : MBEmitter
Start ( ) : IEnumerator

Method Details

ClearPool() public méthode

Remove all instances held by the pool
public ClearPool ( ) : void
Résultat void

Cull() public méthode

Shrink the stock to match MaxPoolSize
public Cull ( ) : void
Résultat void

Cull() public méthode

Shrink the stock to match MaxPoolSize
public Cull ( bool smartCull ) : void
smartCull bool if true a maximum of AllocationBlockSize items are culled
Résultat void

Despawn() public méthode

Despawn an item and add it back to the stock
public Despawn ( MBEmitter item ) : void
item MBEmitter
Résultat void

DespawnAll() public méthode

Despawn all items currently spawned from this pool
public DespawnAll ( ) : void
Résultat void

IsManaged() public méthode

Whether an item is managed by this pool
public IsManaged ( MBEmitter item ) : bool
item MBEmitter an item
Résultat bool

IsSpawned() public méthode

Whether an item is spawned by this pool
public IsSpawned ( MBEmitter item ) : bool
item MBEmitter an item
Résultat bool

LateUpdate() public méthode

public LateUpdate ( ) : void
Résultat void

Populate() public méthode

Create instances and add them to the stock
public Populate ( int no ) : void
no int
Résultat void

PreparePool() public méthode

Clear all instances and repopulate the pool to match MinPoolSize
public PreparePool ( ) : void
Résultat void

Spawn() public méthode

Spawn an instance, make it active and add it to the Spawned list
public Spawn ( ) : MBEmitter
Résultat MBEmitter

callbackAutoDespawn() public méthode

public callbackAutoDespawn ( MBEvent, e ) : void
e MBEvent,
Résultat void

Property Details

AllocationBlockSize public_oe property

The number of items processed at once when the pool need to grow or shrink
public int AllocationBlockSize
Résultat int

AutoCull public_oe property

Whether the pool should automatically cull items that exceeds MaxPoolSize
public bool AutoCull
Résultat bool

AutoDespawn public_oe property

Whether spawned emitters will despawn automatically once they stop playing
public bool AutoDespawn
Résultat bool

CullingSpeed public_oe property

Time in seconds between culling actions
public float CullingSpeed
Résultat float

MaxPoolSize public_oe property

Maximum number of items int the pool
public int MaxPoolSize
Résultat int

MinPoolSize public_oe property

Minimum number of items in the pool
public int MinPoolSize
Résultat int

OnMaxPoolSize public_oe property

Determines the behaviour when the pool exceeds MaxPoolSize
public MBAnchorPoolExceededMode OnMaxPoolSize
Résultat MBAnchorPoolExceededMode

PoolingEnabled public_oe property

Whether this anchor acts as a pooling manager
public bool PoolingEnabled
Résultat bool