public void PerformInteraction() { if (interactableInFocus != null) { if (interactableInFocus.CanInteractWith(pickupHolder.GetHeldItem())) { interactableInFocus.Interact(pickupHolder.GetHeldItem()); // Turn off highlighting here when interaction starts? // Could there be some object we want to keep highlighted while interacting? e.g. a lever or door? // Possibly it would be better to turn off the interaction to display that interaction has commenced } } }
public static void TryInteractAimedWith(PlayerInteractor interactor) { if (aimed != null) { if (aimed.CanInteractWith(interactor)) { aimed.InteractWith(interactor); } else { aimed.BlockedInteractWith(interactor); } } }