From 3be8d2f6a6b17ab83f000aa20366c43503dedffc Mon Sep 17 00:00:00 2001 From: Marro64 Date: Tue, 23 Jun 2026 18:18:17 +0200 Subject: [PATCH] Fixed PacMan speed --- Assets/Scripts/PacMan.cs | 7 ++++--- Assets/Scripts/PlayerInput.cs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/PacMan.cs b/Assets/Scripts/PacMan.cs index f1fa088..9c49b0c 100644 --- a/Assets/Scripts/PacMan.cs +++ b/Assets/Scripts/PacMan.cs @@ -1,5 +1,4 @@ -using System; -using UnityEngine; +using UnityEngine; namespace Marro.PacManUdon { @@ -9,7 +8,7 @@ namespace Marro.PacManUdon Moving, Stopped, Big, - Dead, + Dead, } enum PacManState @@ -290,6 +289,7 @@ namespace Marro.PacManUdon // Debug.Log($"{gameObject} SetLevel {level}"); defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level); powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level); + UpdateSpeed(); } public void SetPowerPellet(bool powerPellet) @@ -357,6 +357,7 @@ namespace Marro.PacManUdon state = (PacManState)data.ReadByte(ref index); freezeSeconds = data.ReadFloat(ref index); frozen = data.ReadBool(ref index); + UpdateSpeed(); return base.WriteSyncedData(data, ref index, eventType); diff --git a/Assets/Scripts/PlayerInput.cs b/Assets/Scripts/PlayerInput.cs index 1f04282..6a0a0b9 100644 --- a/Assets/Scripts/PlayerInput.cs +++ b/Assets/Scripts/PlayerInput.cs @@ -160,7 +160,7 @@ return; } - Debug.Log($"Switched to input direction {newResult} from analogInput {analogInput} with HorizontalPriority {horizontalPriority}"); + //Debug.Log($"Switched to input direction {newResult} from analogInput {analogInput} with HorizontalPriority {horizontalPriority}"); resultInput = newResult; networkManager.SendEventSoon(NetworkEventType.InputChange, true); @@ -199,7 +199,7 @@ var normalized = analogInput.normalized; - Debug.Log($"Checking analogInput {analogInput} with HorizontalPriority {horizontalPriority}, normalized {normalized}"); + //Debug.Log($"Checking analogInput {analogInput} with HorizontalPriority {horizontalPriority}, normalized {normalized}"); const float directionDivider = 0.72f; if (normalized.x > directionDivider)