예제 #1
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Enemy")
     {
         if (!_notAttacking)
         {
             //print("murdering");
             //col.gameObject.SendMessage("Die");
             enemy archibald = col.gameObject.GetComponent <enemy>();
             archibald.Die();
             _score += 50;
             updateScore(_score);
             rb.velocity = new Vector3(attackSpeed, rb.velocity.y, 0);
         }
         else
         {
             gameOver();
         }
     }
 }