C# 클래스 ObjectPool, SimpleObjectPool

상속: MonoBehaviour
파일 보기 프로젝트 열기: gazialankus/SimpleObjectPool 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DefaultContainer Transform
Entries ObjectPoolEntry[]

공개 메소드들

메소드 설명
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

메소드 상세

Awake() 공개 메소드

public Awake ( ) : void
리턴 void

GetObjectForPrefab() 공개 메소드

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. ///
리턴 GameObject

GetPoolEntryForPrefab() 공개 메소드

public GetPoolEntryForPrefab ( GameObject prefab ) : ObjectPoolEntry
prefab GameObject
리턴 ObjectPoolEntry

프로퍼티 상세

DefaultContainer 공개적으로 프로퍼티

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

Entries 공개적으로 프로퍼티

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
리턴 ObjectPoolEntry[]