コード例 #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);
     }
 }
コード例 #2
0
 private void Start()
 {
     animator       = this.GetComponent <Animator>();
     spriteRenderer = this.GetComponent <SpriteRenderer>();
     castRunes      = GetComponentInParent <CastRunes>();
 }
コード例 #3
0
 //On Object Destroy (Safeguard)
 public void OnDestroy()
 {
     instance = null;
 }