A class in Root.Township, the global namespace.
Runs Resources.UnloadUnusedAssets at the end of the frame, from a hidden object it makes on first use. Only one unload runs at a time.
Constructors
| Member | What it is |
|---|
ResourcesCleanup() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private static ResourcesCleanup instance | The cleanup object, made on first Run. |
private static bool isUnloading | True while an unload is in progress. |
Methods
| Member | What it is |
|---|
static void Run() | Starts an end-of-frame unload in play mode if one isn't already running. |
2 private and internal methods
| Member | What it is |
|---|
private void OnDestroy() | Clears the unloading flag. |
private static IEnumerator UnloadAtEndOfFrame() (iterator) | Coroutine that waits for end of frame and unloads unused assets. |