Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        IInteractableData data = other.GetComponent <IInteractableData>();

        if (data != null)
        {
            interactiveObject.RegisterObject(other.gameObject, data.InteractionLogic);
        }
    }
Ejemplo n.º 2
0
    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);
            }
        }
    }