コード例 #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("NPFish"))
     {
         npf = other.transform.parent.GetComponent <NPFish>(); // assumes collider on the child, and script on the parent
         npf.ReturnToPool();                                   // return to the Object Pool, since npf is a pooled object
         npf.ResetNPF();
     }
 }