Class ScreenshotTaker
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Provides a generic implementation of a singleton-like pattern for MonoBehaviour classes. This class automatically searches for an existing instance in the scene or logs an error if none or more than one are found.
[AddComponentMenu("Gamelogic/Extensions/ScreenshotTaker")]
[ExecuteInEditMode]
public sealed class ScreenshotTaker : Singleton<ScreenshotTaker>
- Inheritance
-
ScreenshotTaker
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.runInEditModeComponent.GetComponent<T>()Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentsInParent<T>()Component.transformComponent.gameObjectComponent.tagObject.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.nameObject.hideFlags
- Extension Methods
Remarks
Singletons usually manage their own creation, but it is common in Unity projects to have a singleton already placed in the scene. In this sense, this class really checks whether an instance can be used as a singleton, and then provides access to the instance.
If you want to create a singleton that is not already placed in the scene, you can use put
<xref href="Gamelogic.Extensions.SingletonSpawner%601" data-throw-if-not-resolved="false"></xref> in the scene instead.