예제 #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <BasePairElement>() != null)
     {
         Debug.Log("Colliding");
         onBasePair = true;
         onBP       = other.GetComponent <BasePairElement>();
     }
 }
예제 #2
0
 private void OnTriggerExit(Collider other)
 {
     if (other.GetComponent <BasePairElement>() != null)
     {
         Debug.Log("left");
         onBasePair = false;
         onBP       = null;
     }
     else if (other.GetComponent <ATP>() != null)
     {
         getEnergy();
         other.gameObject.SetActive(false);
         Instantiate(ATPDie, transform.position, transform.rotation);
     }
 }