public virtual void Interaction() { if (interact.interactableObject != null) { if (myInteractions == null) { if (myCurrentInteraction == null) { myCurrentInteraction += pickUpInteraction; interact.callInteract(); } else { interact.interactableObject.pickUpTransform = null; interact.interactableObject = null; myCurrentInteraction -= pickUpInteraction; interact.callInteract(); } } else if (myInteractions != null) { myInteractions(); Debug.Log("Running " + myInteractions); } } else if (interact.interactableObject == null) { if (myCurrentInteraction != null) { myCurrentInteraction = null; } } }
private void ProcessInput() { Move(movementVector, sprint); if (myCurrentInteraction != null) { myCurrentInteraction(); } if (interact.interactableObject == null) { myCurrentInteraction -= pickUpInteraction; } if (Interact) { interact.InteractWithObject(); Interaction(); } if (pickUp) { interact.pickUpObject(myCollider); } }