//On Object Awake private void Awake() { //Check Singleton if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; this.gameObject.SetActive(false); } }
private void Start() { animator = this.GetComponent <Animator>(); spriteRenderer = this.GetComponent <SpriteRenderer>(); castRunes = GetComponentInParent <CastRunes>(); }
//On Object Destroy (Safeguard) public void OnDestroy() { instance = null; }