Property | Type | Description | |
---|---|---|---|
cullExcessObjectsInterval | float | ||
instance | TrashMan, | ||
persistBetweenScenes | bool |
Method | Description | |
---|---|---|
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
|
Method | Description | |
---|---|---|
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
|
public static despawn ( GameObject go ) : void | ||
go | GameObject | Go. |
return | void |
public static despawnAfterDelay ( GameObject go, float delayInSeconds ) : void | ||
go | GameObject | Go. |
delayInSeconds | float | |
return | void |
public static manageRecycleBin ( TrashManRecycleBin, recycleBin ) : void | ||
recycleBin | TrashManRecycleBin, | Recycle bin. |
return | void |
public static recycleBinForGameObject ( GameObject go ) : TrashManRecycleBin, | ||
go | GameObject | Go. |
return | TrashManRecycleBin, |
public static recycleBinForGameObjectName ( string gameObjectName ) : TrashManRecycleBin, | ||
gameObjectName | string | |
return | TrashManRecycleBin, |
public static removeRecycleBin ( TrashManRecycleBin, recycleBin, bool shouldDestroyAllManagedObjects = true ) : void | ||
recycleBin | TrashManRecycleBin, | Recycle bin. |
shouldDestroyAllManagedObjects | bool | If set to |
return | void |
public static spawn ( GameObject go, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion) ) : GameObject | ||
go | GameObject | Go. |
position | Vector3 | |
rotation | Quaternion | |
return | GameObject |
public static spawn ( string gameObjectName, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion) ) : GameObject | ||
gameObjectName | string | |
position | Vector3 | |
rotation | Quaternion | |
return | GameObject |