private void StopListeningTo(TreeCollider other) { other.onTriggerEnter.RemoveListener(OnTriggerEnter); other.onTriggerStay.RemoveListener(OnTriggerStay); other.onTriggerExit.RemoveListener(OnTriggerExit); other.onCollisionEnter.RemoveListener(OnCollisionEnter); other.onCollisionStay.RemoveListener(OnCollisionStay); other.onCollisionExit.RemoveListener(OnCollisionExit); }
private void StartListeningTo(TreeCollider other) { other.onTriggerEnter.AddListener(OnTriggerEnter); other.onTriggerStay.AddListener(OnTriggerStay); other.onTriggerExit.AddListener(OnTriggerExit); other.onCollisionEnter.AddListener(OnCollisionEnter); other.onCollisionStay.AddListener(OnCollisionStay); other.onCollisionExit.AddListener(OnCollisionExit); }