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