Removed clutter from log

This commit is contained in:
2026-06-22 13:35:32 +02:00
parent e431dab042
commit ca116ac77f
7 changed files with 161 additions and 86 deletions

View File

@@ -94,7 +94,7 @@ namespace Marro.PacManUdon
if (!frozen && tile == pacManPosition) if (!frozen && tile == pacManPosition)
{ {
Debug.Log("Ghost hit PacMan!"); //Debug.Log("Ghost hit PacMan!");
ghosts[ghostIndex].HitPacMan(); ghosts[ghostIndex].HitPacMan();
} }
@@ -128,7 +128,7 @@ namespace Marro.PacManUdon
if (ghosts[i].HitPacMan()) // Only one collision may happen at a time if (ghosts[i].HitPacMan()) // Only one collision may happen at a time
{ {
Debug.Log("PacMan hit ghost!"); //Debug.Log("PacMan hit ghost!");
return; return;
} }
} }

View File

@@ -602,12 +602,12 @@ namespace Marro.PacManUdon
if (isScared) if (isScared)
{ {
Debug.Log($"{gameObject} was cought!"); //Debug.Log($"{gameObject} was cought!");
ghostManager.GhostCaught(this); ghostManager.GhostCaught(this);
return true; return true;
} }
Debug.Log($"{gameObject} cought PacMan!"); //Debug.Log($"{gameObject} cought PacMan!");
ghostManager.CapturedPacMan(); ghostManager.CapturedPacMan();
return true; return true;
} }
@@ -725,7 +725,6 @@ namespace Marro.PacManUdon
if (ghostState == PacManGhostState.CaughtScore) if (ghostState == PacManGhostState.CaughtScore)
{ {
ReturnHome(); // Return home when unfreezing after being caught ReturnHome(); // Return home when unfreezing after being caught
collisionManager.PacManTryEatGhost(); // We may have skipped collisions while frozen
} }
} }

View File

@@ -327,7 +327,7 @@ namespace Marro.PacManUdon
obj.networkManager = this; obj.networkManager = this;
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Found {syncedUpdateSubscribers.Length} {nameof(SyncedObject)} in children of {root.name}."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Found {syncedUpdateSubscribers.Length} {nameof(SyncedObject)} in children of {root.name}.");
const int eventTypeCount = byte.MaxValue + 1; const int eventTypeCount = byte.MaxValue + 1;
@@ -375,7 +375,7 @@ namespace Marro.PacManUdon
RequestEvent(NetworkEventType.FullSync); RequestEvent(NetworkEventType.FullSync);
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized");
} }
public void Update() public void Update()
@@ -567,7 +567,7 @@ namespace Marro.PacManUdon
QueueEventInBuffer(data); QueueEventInBuffer(data);
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {data.Length} bytes, timestamp {timestamp} and id {eventId} for serialization."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {data.Length} bytes, timestamp {timestamp} and id {eventId} for serialization.");
RequestSerializationForEvents(); RequestSerializationForEvents();
@@ -647,7 +647,7 @@ namespace Marro.PacManUdon
serializationRequested = false; serializationRequested = false;
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serializing {eventsQueueIndex} event(s), eventTransmissionHistory is now {ArrayToString(eventTransmissionHistory)} with index {eventTransmissionHistoryIndex}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serializing {eventsQueueIndex} event(s), eventTransmissionHistory is now {ArrayToString(eventTransmissionHistory)} with index {eventTransmissionHistoryIndex}");
} }
public override void OnPostSerialization(SerializationResult result) => OnPostSerializationInternal(result.success, result.byteCount); public override void OnPostSerialization(SerializationResult result) => OnPostSerializationInternal(result.success, result.byteCount);
@@ -666,7 +666,7 @@ namespace Marro.PacManUdon
return; return;
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serialized with {networkedData.Length} bytes.\nBytes sent:\n{ArrayToString(networkedData)}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serialized with {networkedData.Length} bytes.\nBytes sent:\n{ArrayToString(networkedData)}");
// Remove data from the buffer that no longer needs to be (re)transmitted // Remove data from the buffer that no longer needs to be (re)transmitted
DequeueEventsFromBuffer(eventTransmissionHistory[eventTransmissionHistoryIndex]); DequeueEventsFromBuffer(eventTransmissionHistory[eventTransmissionHistoryIndex]);
@@ -711,7 +711,7 @@ namespace Marro.PacManUdon
return; // Nothing to store return; // Nothing to store
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Received {networkedData.Length} bytes!\nBytes received:\n{ArrayToString(networkedData)}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Received {networkedData.Length} bytes!\nBytes received:\n{ArrayToString(networkedData)}");
var length = networkedData.Length; var length = networkedData.Length;
int index = 0; int index = 0;
@@ -798,7 +798,7 @@ namespace Marro.PacManUdon
hasFullSyncReady = true; hasFullSyncReady = true;
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Queued full sync in buffer, should execute at {nextEventTime}."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Queued full sync in buffer, should execute at {nextEventTime}.");
} }
private void ApplyReceivedEvents() private void ApplyReceivedEvents()
@@ -842,7 +842,7 @@ namespace Marro.PacManUdon
var subscribers = GetEventSubscribers(eventType); var subscribers = GetEventSubscribers(eventType);
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) ApplyEvent with dt {SyncedDeltaTime}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) ApplyEvent with dt {SyncedDeltaTime}");
if (subscribers != null) if (subscribers != null)
{ {
@@ -878,7 +878,7 @@ namespace Marro.PacManUdon
Synced = true; Synced = true;
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes.");
retriesWithoutSuccess = 0; // We had success! retriesWithoutSuccess = 0; // We had success!
@@ -970,7 +970,7 @@ namespace Marro.PacManUdon
SyncedTime = SyncedTimeTicks * tickDelta; SyncedTime = SyncedTimeTicks * tickDelta;
nextEventTime = timestamp; nextEventTime = timestamp;
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, internalTime is now {targetTicks}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, internalTime is now {targetTicks}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}");
} }
private void UpdateNextEventTime() private void UpdateNextEventTime()

View File

@@ -216,7 +216,7 @@ namespace Marro.PacManUdon
protected override void UpdateAnimator() protected override void UpdateAnimator()
{ {
Debug.Log($"{gameObject} UpdateAnimator with direction {direction}, dead {dead}, frozen {frozen}"); //Debug.Log($"{gameObject} UpdateAnimator with direction {direction}, dead {dead}, frozen {frozen}");
if (!gameObject.activeInHierarchy) if (!gameObject.activeInHierarchy)
return; return;

View File

@@ -43,7 +43,7 @@ MonoBehaviour:
Data: Data:
- Name: - Name:
Entry: 12 Entry: 12
Data: 10 Data: 11
- Name: - Name:
Entry: 7 Entry: 7
Data: Data:
@@ -217,31 +217,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: resultInput Data: player
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: resultInput Data: player
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 13|System.RuntimeType, mscorlib Data: 13|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.Direction, Assembly-CSharp Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 7 Entry: 9
Data: 14|System.RuntimeType, mscorlib Data: 13
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -256,7 +250,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -277,19 +271,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: inputHorizontal Data: inputMethod
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: inputHorizontal Data: inputMethod
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 6
Data: 13 Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 7
Data: 14 Data: 16|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -325,19 +325,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: inputVertical Data: resultInput
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: inputVertical Data: resultInput
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 13 Data: 19|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Direction, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 14 Data: 16
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -352,7 +358,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -373,25 +379,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: horizontalValue Data: inputHorizontal
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: horizontalValue Data: inputHorizontal
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 21|System.RuntimeType, mscorlib Data: 19
- Name:
Entry: 1
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 21 Data: 16
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -427,19 +427,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: verticalValue Data: inputVertical
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: verticalValue Data: inputVertical
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 21 Data: 19
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 21 Data: 16
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -475,19 +475,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: horizontalPriority Data: horizontalValue
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: horizontalPriority Data: horizontalValue
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 7 Data: 26|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 7 Data: 26
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -502,7 +508,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -523,25 +529,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: player Data: verticalValue
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: player Data: verticalValue
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 28|System.RuntimeType, mscorlib Data: 26
- Name:
Entry: 1
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 28 Data: 26
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -572,6 +572,54 @@ MonoBehaviour:
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: horizontalPriority
- Name: $v
Entry: 7
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: horizontalPriority
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name: - Name:
Entry: 13 Entry: 13
Data: Data:

View File

@@ -5,17 +5,27 @@
using VRC.SDKBase; using VRC.SDKBase;
using VRC.Udon.Common; using VRC.Udon.Common;
enum InputMethod
{
KeyboardMouse,
Other,
}
public class PlayerInput : SyncedObject public class PlayerInput : SyncedObject
{ {
public bool active; public bool active;
private GameManager gameManager; private GameManager gameManager;
Direction resultInput;
Direction inputHorizontal; private VRCPlayerApi player;
Direction inputVertical; private InputMethod inputMethod;
float horizontalValue;
float verticalValue; private Direction resultInput;
bool horizontalPriority; private Direction inputHorizontal;
VRCPlayerApi player; private Direction inputVertical;
private float horizontalValue;
private float verticalValue;
private bool horizontalPriority;
public void Initialize(GameManager gameManager) public void Initialize(GameManager gameManager)
{ {
@@ -143,11 +153,29 @@
// Debug.Log("Vertical Input Event: " + value + " | Direction: " + direction + " | lastDirection : " + lastDirection); // Debug.Log("Vertical Input Event: " + value + " | Direction: " + direction + " | lastDirection : " + lastDirection);
} }
public override void OnInputMethodChanged(VRCInputMethod inputMethod)
{
switch (inputMethod)
{
case VRCInputMethod.Keyboard:
case VRCInputMethod.Mouse:
this.inputMethod = InputMethod.KeyboardMouse;
return;
default:
this.inputMethod = InputMethod.Other;
return;
}
}
private void SetPriority(bool horizontalPriority) private void SetPriority(bool horizontalPriority)
{ {
if (this.horizontalPriority != horizontalPriority) if (this.horizontalPriority != horizontalPriority)
{
if (inputMethod != InputMethod.KeyboardMouse)
{ {
player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75); player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75);
}
this.horizontalPriority = horizontalPriority; this.horizontalPriority = horizontalPriority;
} }
} }

View File

@@ -43,7 +43,7 @@ public class NetworkManagerTester : UdonSharpBehaviour
var data = PerformSerialization(source); var data = PerformSerialization(source);
Debug.Log($"{nameof(NetworkManagerTester)} Transferring {data.Length} bytes."); //Debug.Log($"{nameof(NetworkManagerTester)} Transferring {data.Length} bytes.");
foreach (var target in networkManagers) foreach (var target in networkManagers)
{ {
@@ -91,7 +91,7 @@ public class NetworkManagerTester : UdonSharpBehaviour
continue; continue;
} }
Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}."); //Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
target.RequestEventReceived(eventType); target.RequestEventReceived(eventType);
} }