Click or drag to resize

PoolManagerBaseTManagerSettings, TPool, TPoolSettings, TSource, TInstance Class

[This is preliminary documentation and is subject to change.]

An abstract class that provides shared functionality to manage a collection of PoolBaseTSource, TInstance, TSettings components, simplifying access to the pools and allowing for automatic pool creation.
Inheritance Hierarchy
SystemObject
  UnityEngineObject
    UnityEngineComponent
      UnityEngineBehaviour
        UnityEngineMonoBehaviour
          Umbrace.Unity.PurePoolPoolManagerBaseTManagerSettings, TPool, TPoolSettings, TSource, TInstance
            Umbrace.Unity.PurePoolComponentPoolManager
            Umbrace.Unity.PurePoolGameObjectPoolManager

Namespace:  Umbrace.Unity.PurePool
Assembly:  Umbrace.Unity.PurePool (in Umbrace.Unity.PurePool.dll) Version: 0.0.0.0 (1.0.0.0)
Syntax
C#
public abstract class PoolManagerBase<TManagerSettings, TPool, TPoolSettings, TSource, TInstance> : MonoBehaviour, 
	ISerializationCallbackReceiver
where TManagerSettings : PoolManagerSettings<TPoolSettings, TSource>
where TPool : PoolBase<TSource, TInstance, TPoolSettings>
where TPoolSettings : new(), SharedPoolSettings<TSource>

Type Parameters

TManagerSettings
The type of the manager's settings.
TPool
The type of the pools maintained by the manager.
TPoolSettings
The type of the settings used by the pools.
TSource
The type used to identify the desired source when acquiring an instance.
TInstance
The type of the instances returned from the pools.

The PoolManagerBaseTManagerSettings, TPool, TPoolSettings, TSource, TInstance type exposes the following members.

Constructors
  NameDescription
Protected methodPoolManagerBaseTManagerSettings, TPool, TPoolSettings, TSource, TInstance
Initializes a new instance of the PoolManagerBaseTManagerSettings, TPool, TPoolSettings, TSource, TInstance class
Top
Properties
  NameDescription
Public propertyAcquireMode
Gets or sets the way in which to handle attempts to acquire an object, for which no pool exists.
Public propertyAttachDescendentPools
Gets or sets value indicating whether to attach all descendent pools to the manager on startup.
Public propertyDefaultPoolSettings
Gets the settings that are used when a new pool is created.
Public propertyDontDestroyOnLoad
Gets or sets a value indicating whether the pool manager (and the pools beneath it) will remain in the scene when a new scene is loaded.
Public propertyEnabled
Gets or sets a value indicating whether pooling is enabled.
Protected propertyObjectPools
When overridden in a derived class, gets the internal object pool dictionary, mapping from the source object to its pool.
Public propertyPoolCount
Gets the number of pools attached to the manager.
Public propertyPools
Gets the collection of pools attached to the manager.
Top
Methods
  NameDescription
Public methodAcquire
Acquires an instance of source from an attached pool.
Public methodAttachPool
Attaches the specified pool to the manager, allowing the manager to acquire and release instances from it.
Protected methodAwake
Public methodCanAcquire
Determines whether an instance of sourceObject can be acquired from its pool.
Public methodCreatePool(TPoolSettings)
Creates a new pool using the specified settings, and attaches it to the manager. The pool is created on a child object of the manager's game object.
Public methodCreatePool(TPoolSettings, GameObject, Boolean, String)
Creates a new pool using the specified settings, and attaches it to the manager.
Public methodDestroyPool
Destroys the specified pool that's attached to the manager.
Public methodDetachPool
Detaches the specified pool from the manager, without destroying it.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindChildPools
Finds all pools that are parented to the manager's game object.
Public methodGetHashCode (Inherited from Object.)
Public methodGetPool
Gets the pool that handles instances of the specified source object. The manager must contain a matching pool to use this method.
Public methodGetPooledCount
Gets the number of instances of the specified object contained in the pool.
Protected methodGetSourceName
When implemented in a derived class, gets the name of the specified source.
Public methodGetType (Inherited from Object.)
Public methodHasPool
Determines whether the manager has a pool that handles instances of the specified source object.
Protected methodInternalAcquire
When implemented in a derived class, attempts to acquire an instance of a source according to AcquireMode.
Public methodIsAttached
Determines whether the specified pool is attached to the manager.
Public methodIsPoolEmpty
Determines whether the pool is empty for instances of the specified object.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnPoolAttached
Raises the PoolAttached event.
Protected methodOnPoolCreated
Raises the PoolCreated event.
Protected methodOnPoolDestroyed
Raises the PoolDestroyed event.
Protected methodOnPoolDetached
Raises the PoolDetached event.
Public methodRelease
Releases an instance that was previously acquired from an attached pool.
Protected methodReleaseInternal
When overridden in a derived class, releases an instance that was previously acquired from an attached pool.
Public methodToString (Inherited from Object.)
Public methodTryAcquire
Acquires an instance of sourceObject from an attached pool.
Public methodTryGetPool
Gets the pool that handles instances of the specified source object.
Top
Events
  NameDescription
Public eventPoolAttached
Occurs when a GameObjectPool is attached to the manager.
Public eventPoolCreated
Occurs when a GameObjectPool is created by the manager.
Public eventPoolDestroyed
Occurs when a GameObjectPool is destroyed by the manager.
Public eventPoolDetached
Occurs when a GameObjectPool is detached from the manager.
Top
See Also