Click or drag to resize

WeatherMakerScriptFindOrCreateInstanceT Method

Find or create a singleton object. In OnDestroy, you must call ReleaseInstance to avoid memory leaks.

Namespace:  DigitalRuby.WeatherMaker
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
public static T FindOrCreateInstance<T>(
	ref T instance,
	bool required = false
)
where T : MonoBehaviour

Parameters

instance
Type: T
Singleton instance variable
required (Optional)
Type: SystemBoolean
Whether the instance is required

Type Parameters

T
Type of object

Return Value

Type: T
Result, can be null
See Also