コード例 #1
0
 /// <summary>
 /// Force the current interaction to end.
 /// </summary>
 public void EndInteraction()
 {
     if (currentInteractible != null)
     {
         currentInteractible.EndInteraction();
         currentInteractible = null;
     }
 }
コード例 #2
0
        /// <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);
            }
        }
コード例 #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);