19public sealed partial class MovementController : IDisposable
21 private readonly ISceneLayerCoordinates? _coords;
39 internal MovementController(
47 if (layer is not
null)
51 _coords = layer.CoordinateSystem
52 ??
throw new ArgumentException(
53 "SceneLayer must have a CoordinateSystem.",
72 internal bool AdvanceMovement(
float dt)
79 if (AdvanceScripted(dt))
83 return AdvanceIntegrated(dt);
99 _followPixel is not
null ||
100 _followGridTarget is not
null;
143 _state.Velocity = Vector2.Zero;
144 _state.Acceleration = Vector2.Zero;
152 _scriptCompleted =
null;
bool WrapX
Enables or disables horizontal world wrapping. When enabled, movement crossing the left/right edges w...
bool IsScripted
Indicates whether a scripted movement (tween or MoveToward) is currently active.
bool WrapY
Enables or disables vertical world wrapping. When enabled, movement crossing the top/bottom edges wra...
Action< ScriptedMovement >? ScriptedMovementStarted
Raised when a scripted movement (tween or MoveToward) begins. Subscribers are notified exactly once p...
bool IsIntegratedActive
Indicates whether physics-style integration is currently active. Returns true when the controller is ...
MovementState MovementState
Gets the current MovementState containing velocity, acceleration, and motion flags for the controlled...
void Dispose()
Releases resources and detaches all event handlers.
Action< ScriptedMovement >? ScriptedMovementStopped
Raised when a scripted movement (tween or MoveToward) completes or is explicitly cancelled....
void StopAllMovement()
Immediately stops all forms of movement — follow, scripted, and integrated. Cancels active scripted m...
bool IsFollowing
Indicates whether the controller is currently engaged in a follow behavior. Returns true if a pixel o...
void Unfollow()
Stop following any target and clear all follow/tween state (targets, speeds, offsets,...
Represents a single layer within a Scene, containing a grid of tiles and supporting various coordinat...
Defines an object that can be moved within a specific coordinate space.
MovementScriptType
Defines the type of scripted movement behavior applied to an object. Movement scripts control how an ...