private void OnTriggerEnter(Collider other) { if (other.GetComponent <BasePairElement>() != null) { Debug.Log("Colliding"); onBasePair = true; onBP = other.GetComponent <BasePairElement>(); } }
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); } }