private void OnTriggerEnter(Collider other) { IInteractableData data = other.GetComponent <IInteractableData>(); if (data != null) { interactiveObject.RegisterObject(other.gameObject, data.InteractionLogic); } }
private void OnTriggerExit(Collider other) { IInteractableData data = other.GetComponent <IInteractableData>(); if (data != null) { interactiveObject.UnRegisterObject(other.gameObject, data.InteractionLogic); if (interactableObjectType != InteractiveType.Supply) { this.gameObject.SetActive(false); } } }