Files
AppleHillsProduction/Assets/Scripts/Input/IInteractingCharacter.cs
2025-12-15 10:18:43 +01:00

48 lines
1.7 KiB
C#

using System.Threading.Tasks;
using UnityEngine;
namespace Input
{
/// <summary>
/// Interface for characters that can participate in scripted interactions.
/// Provides movement-to-target with arrival/cancellation notifications.
/// Implemented by BasePlayerMovementController to enable all controllers to interact with items.
/// </summary>
public interface IInteractingCharacter
{
/// <summary>
/// Controller-driven interaction movement. Each controller implements its own behavior
/// based on the interactable's settings (characterToInteract, CharacterMoveToTarget, etc.)
/// </summary>
/// <param name="interactable">The interactable to move to</param>
/// <returns>True if movement succeeded and character arrived, false if cancelled/failed</returns>
Task<bool> MoveToInteractableAsync(Interactions.InteractableBase interactable);
/// <summary>
/// Moves character to target position and notifies when arrived/cancelled
/// </summary>
void MoveToAndNotify(Vector3 target);
/// <summary>
/// Interrupts any in-progress MoveToAndNotify operation
/// </summary>
void InterruptMoveTo();
/// <summary>
/// Fired when character arrives at MoveToAndNotify target
/// </summary>
event System.Action OnArrivedAtTarget;
/// <summary>
/// Fired when MoveToAndNotify is cancelled/interrupted
/// </summary>
event System.Action OnMoveToCancelled;
/// <summary>
/// Character's transform (for position queries)
/// </summary>
Transform transform { get; }
}
}