Exemple #1
0
 private void Update()
 {
     if (!alive || hp <= 0)
     {
         try
         {
             po.DestroyObject(this.gameObject);
         }
         catch (MissingReferenceException)
         {
         }
         Destroy(this.gameObject);
     }
 }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     destroyTime -= Time.deltaTime;
     if (destroyTime <= 0f)
     {
         try
         {
             po.DestroyObject(this.gameObject);
         }
         catch (MissingReferenceException)
         {
         }
         Destroy(this.gameObject);
     }
 }