maze_switching (#82)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com> Reviewed-on: #82
This commit is contained in:
47
Assets/Scripts/Input/IInteractingCharacter.cs
Normal file
47
Assets/Scripts/Input/IInteractingCharacter.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user