Class GameObjectOneWayCache
Facilitates object pooling for a pre-specified collection of prefabs with the caveat that objects can be fetched from the cache but not returned. Every frame, the cache needs to be reset, which will return all objects to the pool
Inherited Members
Namespace: UnityEngine.Perception.Randomization.Randomizers.Utilities
Assembly: solution.dll
Syntax
public class GameObjectOneWayCache
Constructors
Name | Description |
---|---|
GameObjectOneWayCache(Transform, GameObject[]) | Creates a new GameObjectOneWayCache |
Properties
Name | Description |
---|---|
NumObjectsActive | The number of active cache objects in the scene |
Methods
Name | Description |
---|---|
GetOrInstantiate(GameObject) | Retrieves an existing instance of the given prefab from the cache if available. Otherwise, instantiate a new instance of the given prefab. |
ResetAllObjects() | Return all active cache objects back to an inactive state |