public void lookAt(PlayerInteractionParams interactionParams) { state = State.TURNING; targetObject = new GameObject("playerRotationTarget"); targetObject.transform.position = interactionParams.interactionPoint; }
public void useIt(PlayerInteractionParams interactionParams) { if (doubleClicked) { state = State.USING; targetObject = Instantiate(interactionParams.obj); targetObject.GetComponent <Renderer>().enabled = false; } }
public void moveTo(PlayerInteractionParams interactionParams) { if (doubleClicked) { state = State.MOVING; targetObject = new GameObject("playerMovementTarget"); targetObject.transform.position = interactionParams.interactionPoint; } }
public void interactWith(PlayerInteractionParams interactionParams, InputAction inputAction) { if (InteractableObjectsManager.isObjectInteractable(interactionParams.obj)) { var interactionType = InteractableObjectsManager.getInteractionType(interactionParams.obj); var interactionTableItems = playerInteractionTable.FindAll(interaction => (interaction.interactionType == interactionType) && (interaction.inputAction == inputAction)); foreach (var interactionTableItem in interactionTableItems) { if (interactionTableItem.interact != null) { interactionTableItem.interact(interactionParams); } } } }