Click or drag to resize

SingletonTCreateInstance Method

If you want more control over when Singletons are created, you can use this to generate it instead of blindly calling the .Instance.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: (
public static T CreateInstance(
	Transform parentTransform = null,
	bool persistBetweenLoads = true


parentTransform (Optional)
Type: Transform
If you want the GameObject for this Singleton to have a certain parent, you can pass in that parent's transform
persistBetweenLoads (Optional)
Type: SystemBoolean
If you want this Singleton to not persist between scene loads, you can pass in false, otherwise it defaults to true

Return Value

Type: T
The Singleton type you created
See Also