Beispiel #1
0
        public void Interact(OnInteracted onInteracted = null)
        {
            Collider2D    closestInteractee = GetClosestInteractee();
            IInteractible interactible      = closestInteractee?.GetComponent <IInteractible>();

            if (interactible != null)
            {
                onInteracted?.Invoke(interactible.InteractibleType, interactible.Transform);
                interactible.Trigger(INTERACTIBLE_TYPE.USER, transform);
            }
        }
        public void Interact()
        {
            Collider      closestInteractee = GetClosestInteractee();
            IInteractible interactible      = closestInteractee?.GetComponent <IInteractible>();

            if (interactible != null)
            {
                interactionHandler.OnInteracted(interactible.InteractibleType, interactible.Transform);
                interactible.Trigger(transform);
            }
        }