ScriptableFactory<T>

Generic factory with object pooling support.

Definition

Namespace: Paragon.Core.ScriptableFactory Assembly: Paragon.dll

[Serializable]
public abstract class ScriptableFactory<TObject> : ScriptableFactory, IScriptableFactory<TObject>
    where TObject : class, IFactorable

Inheritance: ScriptableFactoryScriptableFactory<T>

Properties

Property
Type
Description

PoolCapacity

int

Current number of pooled objects

InitialPoolSize

int

Objects to pre-instantiate on Start

Methods

Instantiate()

Creates a new object and adds it to the pool (inactive).

public TObject Instantiate();

Spawn()

Gets an object from pool (or creates one) and activates it.

Despawn()

Returns an object to the pool.

Destroy()

Permanently destroys a pooled object.

Virtual Callbacks

Abstract Methods

InstantiateObject()

Implement to create the actual object instance.

Example

See Also

Last updated

Was this helpful?