C# Класс 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
Наследование: MBObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
AllocationBlockSize int
AutoCull bool
AutoDespawn bool
CullingSpeed float
MaxPoolSize int
MinPoolSize int
OnMaxPoolSize MBAnchorPoolExceededMode
PoolingEnabled bool

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
AddEmitter ( ) : MBEmitter
AddEmitter ( MBEmitter source ) : MBEmitter
Start ( ) : IEnumerator

Описание методов

ClearPool() публичный Метод

Remove all instances held by the pool
public ClearPool ( ) : void
Результат void

Cull() публичный Метод

Shrink the stock to match MaxPoolSize
public Cull ( ) : void
Результат void

Cull() публичный Метод

Shrink the stock to match MaxPoolSize
public Cull ( bool smartCull ) : void
smartCull bool if true a maximum of AllocationBlockSize items are culled
Результат void

Despawn() публичный Метод

Despawn an item and add it back to the stock
public Despawn ( MBEmitter item ) : void
item MBEmitter
Результат void

DespawnAll() публичный Метод

Despawn all items currently spawned from this pool
public DespawnAll ( ) : void
Результат void

IsManaged() публичный Метод

Whether an item is managed by this pool
public IsManaged ( MBEmitter item ) : bool
item MBEmitter an item
Результат bool

IsSpawned() публичный Метод

Whether an item is spawned by this pool
public IsSpawned ( MBEmitter item ) : bool
item MBEmitter an item
Результат bool

LateUpdate() публичный Метод

public LateUpdate ( ) : void
Результат void

Populate() публичный Метод

Create instances and add them to the stock
public Populate ( int no ) : void
no int
Результат void

PreparePool() публичный Метод

Clear all instances and repopulate the pool to match MinPoolSize
public PreparePool ( ) : void
Результат void

Spawn() публичный Метод

Spawn an instance, make it active and add it to the Spawned list
public Spawn ( ) : MBEmitter
Результат MBEmitter

callbackAutoDespawn() публичный Метод

public callbackAutoDespawn ( MBEvent, e ) : void
e MBEvent,
Результат void

Описание свойств

AllocationBlockSize публичное свойство

The number of items processed at once when the pool need to grow or shrink
public int AllocationBlockSize
Результат int

AutoCull публичное свойство

Whether the pool should automatically cull items that exceeds MaxPoolSize
public bool AutoCull
Результат bool

AutoDespawn публичное свойство

Whether spawned emitters will despawn automatically once they stop playing
public bool AutoDespawn
Результат bool

CullingSpeed публичное свойство

Time in seconds between culling actions
public float CullingSpeed
Результат float

MaxPoolSize публичное свойство

Maximum number of items int the pool
public int MaxPoolSize
Результат int

MinPoolSize публичное свойство

Minimum number of items in the pool
public int MinPoolSize
Результат int

OnMaxPoolSize публичное свойство

Determines the behaviour when the pool exceeds MaxPoolSize
public MBAnchorPoolExceededMode OnMaxPoolSize
Результат MBAnchorPoolExceededMode

PoolingEnabled публичное свойство

Whether this anchor acts as a pooling manager
public bool PoolingEnabled
Результат bool