C# Class LeopotamGroup.Pooling.PoolContainer

Pool container. Supports spawning of named prefab from Resources folder.
Inheritance: UnityEngine.MonoBehaviour
显示文件 Open project: Leopotam/LeopotamGroupLibraryUnity Class Usage Examples

Public Methods

Method Description
CreatePool ( string prefabPath, Transform itemsRoot = null ) : PoolContainer

Creates new pool container for specified prefab.

Get ( ) : IPoolObject

Get new instance of prefab from pool.

Get ( bool &isNew ) : IPoolObject

Get new instance of prefab from pool.

Recycle ( IPoolObject obj ) : void

Recycle specified instance to pool.

Private Methods

Method Description
LoadPrefab ( ) : bool

Method Details

CreatePool() public static method

Creates new pool container for specified prefab.
public static CreatePool ( string prefabPath, Transform itemsRoot = null ) : PoolContainer
prefabPath string Prefab path at Resources folder.
itemsRoot UnityEngine.Transform Root for new items.
return PoolContainer

Get() public method

Get new instance of prefab from pool.
public Get ( ) : IPoolObject
return IPoolObject

Get() public method

Get new instance of prefab from pool.
public Get ( bool &isNew ) : IPoolObject
isNew bool Is instance was created during this call.
return IPoolObject

Recycle() public method

Recycle specified instance to pool.
public Recycle ( IPoolObject obj ) : void
obj IPoolObject Instance to recycle.
return void