1 using System.Collections;
2 using System.Collections.Generic;
12 public static T Instance
16 if (_Instance == null) _Instance = FindObjectOfType<T>();
34 if (_Instance != null && _Instance !=
this)
36 AVR_DevConsole.cwarn(this.name +
" is marked as Singleton but another instance was found in the scene. Continuing to use old one.",
this);
40 Instance = gameObject.GetComponent<T>();
44 AVR_DevConsole.cerror(this.name +
" is marked as a Singleton of type " + typeof(T).ToString() +
" but no component of this type was found!",
this);
47 DontDestroyOnLoad(
this);
Monobehaviour but with an added URL button to a documentation page.
virtual void OnApplicationQuit()