C# Class ObjectPool, SimpleObjectPool

Inheritance: MonoBehaviour
Afficher le fichier Open project: gazialankus/SimpleObjectPool Class Usage Examples

Méthodes publiques

Свойство Type Description
DefaultContainer Transform
Entries ObjectPoolEntry[]

Méthodes publiques

Méthode Description
Awake ( ) : void
GetObjectForPrefab ( GameObject prefabGameObject, bool onlyPooled ) : GameObject

Gets a new object for the name type provided. If no object type exists or if onlypooled is true and there is no objects of that type in the pool then null will be returned.

GetPoolEntryForPrefab ( GameObject prefab ) : ObjectPoolEntry

Method Details

Awake() public méthode

public Awake ( ) : void
Résultat void

GetObjectForPrefab() public méthode

Gets a new object for the name type provided. If no object type exists or if onlypooled is true and there is no objects of that type in the pool then null will be returned.
public GetObjectForPrefab ( GameObject prefabGameObject, bool onlyPooled ) : GameObject
prefabGameObject GameObject /// Object type. ///
onlyPooled bool /// If true, it will only return an object if there is one currently pooled. ///
Résultat GameObject

GetPoolEntryForPrefab() public méthode

public GetPoolEntryForPrefab ( GameObject prefab ) : ObjectPoolEntry
prefab GameObject
Résultat ObjectPoolEntry

Property Details

DefaultContainer public_oe property

The container object that we will keep unused pooled objects so we dont clog up the editor with objects.
public Transform DefaultContainer
Résultat Transform

Entries public_oe property

The object prefabs which the pool can handle by The amount of objects of each type to buffer. Consider using a dictionary if there are many.
public ObjectPoolEntry[] Entries
Résultat ObjectPoolEntry[]