C# 클래스 TrashMan, RecyclerKit

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

공개 프로퍼티들

프로퍼티 타입 설명
cullExcessObjectsInterval float
instance TrashMan,
persistBetweenScenes bool

공개 메소드들

메소드 설명
despawn ( GameObject go ) : void

sticks the GameObject back into its recycle bin. If the GameObject has no bin it is destroyed.

despawnAfterDelay ( GameObject go, float delayInSeconds ) : void

sticks the GameObject back into it's recycle bin after a delay. If the GameObject has no bin it is destroyed.

manageRecycleBin ( TrashManRecycleBin, recycleBin ) : void

tells TrashMan to start managing the recycle bin at runtime

recycleBinForGameObject ( GameObject go ) : TrashManRecycleBin,

gets the recycle bin for the given GameObject. Returns null if none exists.

recycleBinForGameObjectName ( string gameObjectName ) : TrashManRecycleBin,

gets the recycle bin for the given GameObject name. Returns null if none exists.

removeRecycleBin ( TrashManRecycleBin, recycleBin, bool shouldDestroyAllManagedObjects = true ) : void

stops managing the recycle bin optionally destroying all managed objects

spawn ( GameObject go, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion) ) : GameObject

pulls an object out of the recycle bin

spawn ( string gameObjectName, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion) ) : GameObject

pulls an object out of the recycle bin using the bin's name

비공개 메소드들

메소드 설명
Awake ( ) : void
OnApplicationQuit ( ) : void
activeSceneChanged ( Scene, oldScene, Scene, newScene ) : void
cullExcessObjects ( ) : IEnumerator

coroutine that runs every couple seconds and removes any objects created over the recycle bins limit

initializePrefabPools ( ) : void

populats the lookup dictionaries

internalDespawnAfterDelay ( GameObject go, float delayInSeconds ) : IEnumerator

internal coroutine for despawning after a delay

spawn ( int gameObjectInstanceId, Vector3 position, Quaternion rotation ) : GameObject

internal method that actually does the work of grabbing the item from the bin and returning it

메소드 상세

despawn() 공개 정적인 메소드

sticks the GameObject back into its recycle bin. If the GameObject has no bin it is destroyed.
public static despawn ( GameObject go ) : void
go GameObject Go.
리턴 void

despawnAfterDelay() 공개 정적인 메소드

sticks the GameObject back into it's recycle bin after a delay. If the GameObject has no bin it is destroyed.
public static despawnAfterDelay ( GameObject go, float delayInSeconds ) : void
go GameObject Go.
delayInSeconds float
리턴 void

manageRecycleBin() 공개 정적인 메소드

tells TrashMan to start managing the recycle bin at runtime
public static manageRecycleBin ( TrashManRecycleBin, recycleBin ) : void
recycleBin TrashManRecycleBin, Recycle bin.
리턴 void

recycleBinForGameObject() 공개 정적인 메소드

gets the recycle bin for the given GameObject. Returns null if none exists.
public static recycleBinForGameObject ( GameObject go ) : TrashManRecycleBin,
go GameObject Go.
리턴 TrashManRecycleBin,

recycleBinForGameObjectName() 공개 정적인 메소드

gets the recycle bin for the given GameObject name. Returns null if none exists.
public static recycleBinForGameObjectName ( string gameObjectName ) : TrashManRecycleBin,
gameObjectName string
리턴 TrashManRecycleBin,

removeRecycleBin() 공개 정적인 메소드

stops managing the recycle bin optionally destroying all managed objects
public static removeRecycleBin ( TrashManRecycleBin, recycleBin, bool shouldDestroyAllManagedObjects = true ) : void
recycleBin TrashManRecycleBin, Recycle bin.
shouldDestroyAllManagedObjects bool If set to true should destroy all managed objects.
리턴 void

spawn() 공개 정적인 메소드

pulls an object out of the recycle bin
public static spawn ( GameObject go, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion) ) : GameObject
go GameObject Go.
position Vector3
rotation Quaternion
리턴 GameObject

spawn() 공개 정적인 메소드

pulls an object out of the recycle bin using the bin's name
public static spawn ( string gameObjectName, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion) ) : GameObject
gameObjectName string
position Vector3
rotation Quaternion
리턴 GameObject

프로퍼티 상세

cullExcessObjectsInterval 공개적으로 프로퍼티

this is how often in seconds TrashMan should cull excess objects. Setting this to 0 or a negative number will fully turn off automatic culling. You can then use the TrashManRecycleBin.cullExcessObjects method manually if you would still like to do any culling.
public float cullExcessObjectsInterval
리턴 float

instance 공개적으로 정적으로 프로퍼티

access to the singleton
public static TrashMan, instance
리턴 TrashMan,

persistBetweenScenes 공개적으로 프로퍼티

if true, DontDestroyOnLoad will be called on the TrashMan
public bool persistBetweenScenes
리턴 bool