private void OnCollisionExit(Collision collision) { if (collision.gameObject.TryGetComponent(out Buttonv2 button)) { myButton = null; } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.TryGetComponent(out Buttonv2 button)) { myButton = button; } }
private void RemoveFromButton() { myButton.OnTransformLeave(elementHandler); myButton = null; }