Beispiel #1
0
 // this is seperated one for onCollision
 private void OnParticleCollision(GameObject other)
 {
     // add the score
     sb.ScoreHit(scorePerHit);
     HP--;
     if (HP <= 0)
     {
         // create the explosive effect with no rotation
         GameObject temp = Instantiate(deathFX, transform.position, Quaternion.identity);
         temp.transform.parent = parent;
         print("enemy hit " + gameObject.name);
         Destroy(gameObject);
     }
 }
Beispiel #2
0
 void OnParticleCollision(GameObject other)
 {
     sb.ScoreHit(scorePerHit);
     Destroy(gameObject);
     Instantiate(deathFX, transform.position, Quaternion.identity);
 }