コード例 #1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.other.gameObject.CompareTag("Player"))
     {
         PlayerMovement p = collision.other.gameObject.GetComponent <PlayerMovement>();
         if (p)
         {
             p.AddTorpedos(1);
             Destroy(gameObject);
         }
     }
 }