NamedGameObjectPoolManager Class |
[This is preliminary documentation and is subject to change.]
Namespace: Umbrace.Unity.PurePool
public class NamedGameObjectPoolManager : MonoBehaviour, ISerializationCallbackReceiver
The NamedGameObjectPoolManager type exposes the following members.
| Name | Description | |
|---|---|---|
| NamedGameObjectPoolManager | Initializes a new instance of the NamedGameObjectPoolManager class |
| Name | Description | |
|---|---|---|
| AssignedNames |
Gets a list of the names currently assigned to game objects.
| |
| AutoAddFromManager |
Gets or sets a value indicating whether to automatically provide named access to the pools attached to the manager.
| |
| Instance |
Gets the NamedGameObjectPoolManager found in the scene.
| |
| Item |
Gets the pool that handles instances of the source object with the specified name.
The manager must contain a matching pool to use this method.
| |
| Manager |
Gets or sets the pool manager whose pools should be accessed by name.
| |
| UseResources |
Gets or sets a value indicating whether to attempt to locate unrecognised names using Load(String).
|
| Name | Description | |
|---|---|---|
| Acquire(String) |
Acquires an instance of the source object with the specified name, from an attached pool.
| |
| Acquire(String, Transform) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its parent transform.
| |
| Acquire(String, Transform, Boolean) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its parent transform.
| |
| Acquire(String, Vector3, Quaternion) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its position and rotation.
| |
| Acquire(String, Vector3, Quaternion, Transform) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its parent transform, position and rotation.
| |
| CanAcquire |
Determines whether an instance of the source object with the specified name can be acquired from its pool.
| |
| Equals | (Inherited from Object.) | |
| Finalize | (Inherited from Object.) | |
| GetGameObject |
Gets the GameObject that is currently assigned the specified name.
| |
| GetHashCode | (Inherited from Object.) | |
| GetName |
Gets the name that is currently assigned to the specified GameObject.
| |
| GetPool |
Gets the pool that handles instances of the source object with the specified name.
The manager must contain a matching pool to use this method.
| |
| GetPooledCount |
Gets the number of instances of the object with the specified name contained in the pool.
| |
| GetType | (Inherited from Object.) | |
| HasName(String) |
Determines whether the specified name is currently assigned.
| |
| HasName(GameObject) |
Determines whether the specified GameObject is currently assigned a name.
| |
| HasPool |
Determines whether the manager has a pool that handles instances of the source object with the specified name.
| |
| IsPoolEmpty |
Determines whether the pool is empty for instances of the object with the specified name.
| |
| MemberwiseClone | (Inherited from Object.) | |
| OnChanged |
Raises the Changed event.
| |
| Release |
Releases an instance of a game object that was previously acquired from a pool.
| |
| RemoveName(String) |
Removes the specified named access.
| |
| RemoveName(GameObject) |
Removes the named access to the specified GameObject.
| |
| SetName |
Assigns a name to the specified GameObject.
| |
| ToString | (Inherited from Object.) | |
| TryAcquire(String, GameObject) |
Acquires an instance of the source object with the specified name, from an attached pool.
| |
| TryAcquire(String, Transform, GameObject) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its parent transform.
| |
| TryAcquire(String, Transform, Boolean, GameObject) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its parent transform.
| |
| TryAcquire(String, Vector3, Quaternion, GameObject) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its position and rotation.
| |
| TryAcquire(String, Vector3, Quaternion, Transform, GameObject) |
Acquires an instance of the source object with the specified name from an attached pool, and sets its parent transform, position and rotation.
| |
| TryGetGameObject |
Gets the GameObject that is currently assigned the specified name.
| |
| TryGetName |
Gets the name that is currently assigned to the specified GameObject.
| |
| TryGetPool |
Gets the pool that handles instances of the source object with the specified name.
|
// Create the component on a game object. var byName = gameObject.AddComponent<NamedGameObjectPoolManager>(); // Set up the properties. byName.Manager = manager; byName.AutoAddFromManager = true; // Assign custom names to the objects being pooled. byName.SetName(prefab, "Asteroid_1"); // Acquire an instance of the "prefab" object, using its string name. var instance = byName.Acquire("Asteroid_1"); // Access the GameObjectPool that stores the "prefab" instances. GameObjectPool asteroidPool = byName["Asteroid_1"]; // Release the acquired instance back to the pool. byName.Release(instance);