This commit is contained in:
2026-06-18 11:59:21 +02:00
parent e4ffe97c03
commit f44929c109
9 changed files with 558 additions and 517 deletions

View File

@@ -18,6 +18,7 @@ namespace Marro.PacManUdon
public abstract class GridMover : SyncedObject
{
protected Direction direction;
protected Direction targetDirection;
// Cannot be static, much to my annoyance
public readonly Vector2[] directionVectors =
@@ -66,6 +67,19 @@ namespace Marro.PacManUdon
UpdateAnimator();
}
protected void SetTargetDirection(Direction targetDirection)
{
this.targetDirection = targetDirection;
UpdateAnimator();
}
public void SetDirectionAndTargetDirection(Direction direction)
{
this.direction = direction;
this.targetDirection = direction;
UpdateAnimator();
}
protected static Direction VectorToDirection(Vector2 vector)
{
var directionId = 0;