/// <summary>
 /// Force the current interaction to end.
 /// </summary>
 public void EndInteraction()
 {
     if (currentInteractible != null)
     {
         currentInteractible.EndInteraction();
         currentInteractible = null;
     }
 }
        /// <summary>
        /// Interact with the given object.
        /// </summary>
        public void Interact(Interactible interactible)
        {
            if (currentInteractible == null || !currentInteractible.StillInteracting)
            {
                currentInteractible = interactible;
            }

            currentInteractible.OnInteract();

            if (!currentInteractible.StillInteracting)
            {
                currentInteractible = null;
            }
            else
            {
                fsm.Signal(currentInteractible.gameObject);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Interact with a particular object.
 /// </summary>
 /// <param name="interactible">The object to interact with.</param>
 public void Interact(Interactible interactible) => Interaction.Interact(interactible);