void OnCollisionExit(Collision collision) { if (callableObject == null) { callableObject = calledObject.GetComponent <CollisionCallable>(); } callableObject.OnCollisionExit(collision); }
void OnTriggerEnter(Collider collider) { if (callableObject == null) { callableObject = calledObject.GetComponent <CollisionCallable>(); } callableObject.OnTriggerEnter(collider); }
// Start is called before the first frame update void Start() { callableObject = calledObject.GetComponent <CollisionCallable>(); if (calledObject == null) { Destroy(this); } }