示例#1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.transform == target)
     {
         if (other.tag == "Enemy" || other.tag == "Corvette" || other.tag == "Boss")
         {
             ITakeDamage takedmg = other.GetComponent <ITakeDamage>();
             if (takedmg != null)
             {
                 takedmg.takeDamage(damage);
             }
             Instantiate(explosion, transform.position, transform.rotation);
             Destroy(gameObject);
         }
     }
 }