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

@@ -25,7 +25,6 @@ namespace Marro.PacManUdon
private Direction[] predefinedPath;
private int predefinedPathIndex;
private Direction targetDirection;
private float freezeSeconds;
private bool frozen;
@@ -187,8 +186,7 @@ namespace Marro.PacManUdon
// If we're at a Vector2.zero, we skip applying the direction and only increment.
if (nextValidDirectionIndex == predefinedPathIndex)
{
SetDirection(predefinedPath[nextValidDirectionIndex]);
SetTargetDirection(predefinedPath[nextValidDirectionIndex]);
SetDirectionAndTargetDirection(predefinedPath[nextValidDirectionIndex]);
nextPosition = PositionToGrid(nextPosition) + directionVectors[(int)direction] * 0.01f;
// Check if we've reached the end of the path, which includes making sure the path doesn't end on Vector2.zero
@@ -334,12 +332,6 @@ namespace Marro.PacManUdon
renderer.enabled = visible;
}
public void SetTargetDirection(Direction targetDirection)
{
this.targetDirection = targetDirection;
UpdateAnimator();
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.PacManTurn)