Finalize work on the dump controller switching
This commit is contained in:
@@ -330,6 +330,31 @@ namespace Input
|
||||
|
||||
#region IInteractingCharacter Implementation
|
||||
|
||||
/// <summary>
|
||||
/// Controller-driven interaction movement. Base implementation moves this controller to the interactable.
|
||||
/// Override in derived classes for custom behavior (e.g., PlayerTouchController handles follower dispatch).
|
||||
/// </summary>
|
||||
public virtual async System.Threading.Tasks.Task<bool> MoveToInteractableAsync(Interactions.InteractableBase interactable)
|
||||
{
|
||||
// Default behavior: move self to interactable position
|
||||
Vector3 targetPosition = interactable.transform.position;
|
||||
|
||||
// Check for custom CharacterMoveToTarget
|
||||
var moveTargets = interactable.GetComponentsInChildren<Interactions.CharacterMoveToTarget>();
|
||||
foreach (var target in moveTargets)
|
||||
{
|
||||
if (target.characterType == Interactions.CharacterToInteract.Trafalgar ||
|
||||
target.characterType == Interactions.CharacterToInteract.Both)
|
||||
{
|
||||
targetPosition = target.GetTargetPosition();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Use MovementUtilities to handle movement
|
||||
return await Utils.MovementUtilities.MoveToPositionAsync(this, targetPosition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the character to a specific target position and notifies via events when arrived or cancelled.
|
||||
/// This is used by systems like interactions to orchestrate scripted movement.
|
||||
|
||||
Reference in New Issue
Block a user