Inheritance: MonoBehaviour
Esempio n. 1
0
	private void Awake() {
		if (instance) {
			Debug.LogWarning("Only one " + GetType().Name + " should exist at a time, instantiated by the " + typeof(DisposalQueue).Name + " class.");
			Destroy(this);
		} else {
			instance = this;
			DontDestroyOnLoad(this);
		}
	}
Esempio n. 2
0
 private void Awake()
 {
     if (instance)
     {
         Debug.LogWarning("Only one " + GetType().Name + " should exist at a time, instantiated by the " + typeof(DisposalQueue).Name + " class.");
         Destroy(this);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
 }