//On Object Awake private void Awake() { //Check Singleton if (instance != null && instance != this) { Destroy(this); } else { instance = this; } }
//On Object Destroy (Safeguard) public void OnDestroy() { instance = null; }