예제 #1
0
파일: Bullet.cs 프로젝트: mahraan/sgf
 void OnTriggerEnter2D(Collider2D col)
 {
     print(col.name);
     if (col.tag == "slash" || col.tag == "shield")
     {
         GetComponent <Rigidbody2D>().velocity = -GetComponent <Rigidbody2D>().velocity *reflectMultiplier;
     }
     else if (col.tag == "ground" || col.tag == "bullet" || col.tag == "select_border")
     {
         Destroy(this.gameObject);
     }
     else if (col.tag == "Player")
     {
         GameObject g     = GameObject.Find(col.name);
         player     other = g.GetComponent <player>();
         if (!other.dead && !other.respawn && !other.invincible)
         {
             other.FindKiller(this.gameObject, true);
             Destroy(this.gameObject);
         }
     }
 }