From 154c642ccee708d390dd9362f826c4b8f5fd948d Mon Sep 17 00:00:00 2001 From: Marro64 Date: Fri, 16 Jan 2026 20:36:21 +0100 Subject: [PATCH] Pacman syncs really well now --- Assets/Scenes/PacMan.unity | 423 +++++++++++++++++- Assets/Scripts/GameManager.cs | 15 +- Assets/Scripts/Ghost.asset | 334 ++++++-------- Assets/Scripts/Ghost.cs | 16 +- Assets/Scripts/GhostManager.cs | 5 +- Assets/Scripts/GridMover.cs | 2 - Assets/Scripts/Maze.asset | 82 +++- Assets/Scripts/Maze.cs | 11 +- Assets/Scripts/NetworkManager.asset | 392 ++++++++++------ Assets/Scripts/NetworkManager.cs | 70 ++- Assets/Scripts/PacMan.asset | 310 ++++++------- Assets/Scripts/PacMan.cs | 7 +- Assets/Scripts/Sequences/StartNewGame.cs | 2 - .../Scripts/Sequences/TimeSequenceShared.cs | 19 +- Assets/Test stuff/TestBallManager.cs | 4 +- 15 files changed, 1099 insertions(+), 593 deletions(-) diff --git a/Assets/Scenes/PacMan.unity b/Assets/Scenes/PacMan.unity index 4e3fd6e..1298bb8 100644 --- a/Assets/Scenes/PacMan.unity +++ b/Assets/Scenes/PacMan.unity @@ -2095,6 +2095,11 @@ Transform: m_CorrespondingSourceObject: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} m_PrefabInstance: {fileID: 1395880782} m_PrefabAsset: {fileID: 0} +--- !u!4 &78695510 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + m_PrefabInstance: {fileID: 255882587} + m_PrefabAsset: {fileID: 0} --- !u!1001 &79208948 PrefabInstance: m_ObjectHideFlags: 0 @@ -2601,7 +2606,9 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 1672574592} + - {fileID: 2005609925} m_Father: {fileID: 1886023632} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &106686679 @@ -3006,6 +3013,11 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} +--- !u!4 &139893418 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + m_PrefabInstance: {fileID: 212701736} + m_PrefabAsset: {fileID: 0} --- !u!1 &140466951 GameObject: m_ObjectHideFlags: 0 @@ -5924,6 +5936,79 @@ Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} m_PrefabInstance: {fileID: 1989589316} m_PrefabAsset: {fileID: 0} +--- !u!1001 &212701736 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 661995937} + m_Modifications: + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.y + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.z + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.x + value: 13.5 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.y + value: -13.999999 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_Name + value: PinkyStart + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f10209aafcd484f438cbd0888287e98a, type: 3} --- !u!1 &213614170 GameObject: m_ObjectHideFlags: 0 @@ -8377,6 +8462,79 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} +--- !u!1001 &255882587 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 661995937} + m_Modifications: + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.y + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.z + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.x + value: 13.5 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.y + value: -10.999999 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_Name + value: BlinkyStart + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f10209aafcd484f438cbd0888287e98a, type: 3} --- !u!1001 &260558048 PrefabInstance: m_ObjectHideFlags: 0 @@ -20593,6 +20751,42 @@ Transform: m_Children: [] m_Father: {fileID: 712073434} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &661995936 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 661995937} + m_Layer: 0 + m_Name: StartPositions + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &661995937 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 661995936} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1381923126} + - {fileID: 78695510} + - {fileID: 139893418} + - {fileID: 1753905475} + - {fileID: 1446951705} + m_Father: {fileID: 973113515} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &662144548 stripped Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} @@ -29055,7 +29249,7 @@ Transform: - {fileID: 140466955} - {fileID: 540296258} - {fileID: 1777057123} - - {fileID: 1381923126} + - {fileID: 661995937} - {fileID: 453407310} - {fileID: 1400026974} - {fileID: 667019553} @@ -29127,6 +29321,11 @@ MonoBehaviour: - {fileID: 428355820} - {fileID: 784242305} - {fileID: 252759758} + ghostStarts: + - {fileID: 78695510} + - {fileID: 139893418} + - {fileID: 1753905475} + - {fileID: 1446951705} pacManStart: {fileID: 1381923126} --- !u!1001 &973123592 PrefabInstance: @@ -42583,6 +42782,79 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} +--- !u!1001 &1377923267 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 661995937} + m_Modifications: + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.y + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.z + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.x + value: 15.5 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.y + value: -13.999999 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_Name + value: ClydeStart + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f10209aafcd484f438cbd0888287e98a, type: 3} --- !u!4 &1379171649 stripped Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} @@ -42997,7 +43269,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 973113515} + m_TransformParent: {fileID: 661995937} m_Modifications: - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} propertyPath: m_LocalScale.x @@ -45284,6 +45556,11 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1443393217} m_CullTransparentMesh: 1 +--- !u!4 &1446951705 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + m_PrefabInstance: {fileID: 1377923267} + m_PrefabAsset: {fileID: 0} --- !u!4 &1447775135 stripped Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} @@ -51240,6 +51517,37 @@ Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} m_PrefabInstance: {fileID: 821031933} m_PrefabAsset: {fileID: 0} +--- !u!1 &1672574591 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1672574592} + m_Layer: 0 + m_Name: Level display gone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1672574592 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1672574591} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 106401850} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1673553850 GameObject: m_ObjectHideFlags: 0 @@ -55419,6 +55727,11 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} +--- !u!4 &1753905475 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + m_PrefabInstance: {fileID: 2069408335} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1757145031 PrefabInstance: m_ObjectHideFlags: 0 @@ -61835,6 +62148,37 @@ Transform: m_Children: [] m_Father: {fileID: 806746267} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2005609924 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2005609925} + m_Layer: 0 + m_Name: Intermission 2 pole broken + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2005609925 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2005609924} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 106401850} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &2008316875 stripped Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} @@ -63631,6 +63975,79 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1001 &2069408335 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 661995937} + m_Modifications: + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.y + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalScale.z + value: 1.0000002 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.x + value: 11.5 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.y + value: -13.999999 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2303859902328226329, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_Name + value: InkyStart + objectReference: {fileID: 0} + - target: {fileID: 6416098964784429726, guid: f10209aafcd484f438cbd0888287e98a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f10209aafcd484f438cbd0888287e98a, type: 3} --- !u!1001 &2071241598 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index c0145b0..01c9aea 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -1,13 +1,8 @@ -#define RECORDING_DEMO +using UdonSharp; +using UnityEngine; namespace Marro.PacManUdon { - using System; - using UdonSharp; - using UnityEngine; - using VRC.SDK3.Components; - using VRC.SDKBase; - public partial class GameManager : SyncedObject { [Header("Static game components")] @@ -16,7 +11,7 @@ namespace Marro.PacManUdon [SerializeField] private GhostManager ghostManager; [SerializeField] private BonusFruit bonusFruit; [SerializeField] private PelletManager pelletManager; - [SerializeField] public StatusDisplay statusDisplay; // This one is public so other scripts can write to the debug display + [SerializeField] private StatusDisplay statusDisplay; [SerializeField] private PelletManager attractScreen; [SerializeField] private GameObject intermissionScreen; [SerializeField] private GameObject pressStartButtonScreen; @@ -68,7 +63,7 @@ namespace Marro.PacManUdon intermission2Pole = intermissionScreenElements[4].GetComponent(); networkManager.Initialize(); - ghostManager.Initialize(maze.ghostTargets, pacMan, this); + ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, this); pacMan.Initialize(playerInput, maze.pacManStart, this); bonusFruit.Initialize(); pelletManager.Initialize(); @@ -114,7 +109,7 @@ namespace Marro.PacManUdon Debug.Log($"{gameObject} Start Game Button was pressed!"); if (networkManager.IsOwner) { - networkManager.SendEvent(NetworkEventType.StartGameButtonPressed); + networkManager.SendEventNow(NetworkEventType.StartGameButtonPressed); } StartTimeSequence(PacManTimeSequence.StartNewGame); } diff --git a/Assets/Scripts/Ghost.asset b/Assets/Scripts/Ghost.asset index 938138a..fd3b977 100644 --- a/Assets/Scripts/Ghost.asset +++ b/Assets/Scripts/Ghost.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 38 + Data: 37 - Name: Entry: 7 Data: @@ -721,19 +721,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: startScale + Data: homePosition - Name: $v Entry: 7 Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: startScale + Data: homePosition - Name: k__BackingField Entry: 9 - Data: 37 + Data: 7 - Name: k__BackingField Entry: 9 - Data: 37 + Data: 7 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -769,13 +769,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: homePosition + Data: idlePosition1 - Name: $v Entry: 7 Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: homePosition + Data: idlePosition1 - Name: k__BackingField Entry: 9 Data: 7 @@ -817,13 +817,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: idlePosition1 + Data: idlePosition2 - Name: $v Entry: 7 Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: idlePosition1 + Data: idlePosition2 - Name: k__BackingField Entry: 9 Data: 7 @@ -865,13 +865,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: idlePosition2 + Data: cornerPosition - Name: $v Entry: 7 Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: idlePosition2 + Data: cornerPosition - Name: k__BackingField Entry: 9 Data: 7 @@ -913,19 +913,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: cornerPosition + Data: kinematic - Name: $v Entry: 7 Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: cornerPosition + Data: kinematic - Name: k__BackingField - Entry: 9 - Data: 7 + Entry: 7 + Data: 51|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 7 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -940,7 +946,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 52|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -961,25 +967,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: kinematic + Data: horizontalOnly - Name: $v Entry: 7 - Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: kinematic + Data: horizontalOnly - Name: k__BackingField - Entry: 7 - Data: 53|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Boolean, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1015,19 +1015,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: horizontalOnly + Data: housePelletCounterLimit - Name: $v Entry: 7 Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: horizontalOnly + Data: housePelletCounterLimit - Name: k__BackingField Entry: 9 - Data: 53 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1063,19 +1063,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: housePelletCounterLimit + Data: faceInStartingDirectionUntilUnfrozen - Name: $v Entry: 7 Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: housePelletCounterLimit + Data: faceInStartingDirectionUntilUnfrozen - Name: k__BackingField Entry: 9 - Data: 11 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1111,19 +1111,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: faceInStartingDirectionUntilUnfrozen + Data: specialLook - Name: $v Entry: 7 Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: faceInStartingDirectionUntilUnfrozen + Data: specialLook - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1159,19 +1159,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: specialLook + Data: followingPredefinedPath - Name: $v Entry: 7 Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: specialLook + Data: followingPredefinedPath - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1207,19 +1207,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: followingPredefinedPath + Data: predefinedPath - Name: $v Entry: 7 Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: followingPredefinedPath + Data: predefinedPath - Name: k__BackingField - Entry: 9 - Data: 53 + Entry: 7 + Data: 64|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector2[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 53 + Data: 64 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1234,7 +1240,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1255,25 +1261,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: predefinedPath + Data: predefinedPathIndex - Name: $v Entry: 7 - Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: predefinedPath + Data: predefinedPathIndex - Name: k__BackingField - Entry: 7 - Data: 66|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Vector2[], UnityEngine.CoreModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 66 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1309,13 +1309,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: predefinedPathIndex + Data: rngState - Name: $v Entry: 7 Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: predefinedPathIndex + Data: rngState - Name: k__BackingField Entry: 9 Data: 11 @@ -1357,19 +1357,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: rngState + Data: speed - Name: $v Entry: 7 Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: rngState + Data: speed - Name: k__BackingField - Entry: 9 - Data: 11 + Entry: 7 + Data: 71|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 11 + Data: 71 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1384,7 +1390,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 71|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1405,25 +1411,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: speed + Data: target - Name: $v Entry: 7 - Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: speed + Data: target - Name: k__BackingField - Entry: 7 - Data: 73|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Single, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 7 - Name: k__BackingField Entry: 9 - Data: 73 + Data: 7 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1459,19 +1459,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: target + Data: offGrid - Name: $v Entry: 7 Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: target + Data: offGrid - Name: k__BackingField Entry: 9 - Data: 7 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 7 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1507,19 +1507,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: offGrid + Data: inTunnel - Name: $v Entry: 7 Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: offGrid + Data: inTunnel - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1555,19 +1555,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: inTunnel + Data: ghostState - Name: $v Entry: 7 Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: inTunnel + Data: ghostState - Name: k__BackingField - Entry: 9 - Data: 53 + Entry: 7 + Data: 80|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.PacManGhostState, Assembly-CSharp + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 53 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1582,7 +1588,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 80|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 81|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1603,25 +1609,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: ghostState + Data: isScared - Name: $v Entry: 7 - Data: 81|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 82|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: ghostState + Data: isScared - Name: k__BackingField - Entry: 7 - Data: 82|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.PacManGhostState, Assembly-CSharp - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1657,19 +1657,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: isScared + Data: scattering - Name: $v Entry: 7 Data: 84|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: isScared + Data: scattering - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1705,19 +1705,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: scattering + Data: frozenState - Name: $v Entry: 7 Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: scattering + Data: frozenState - Name: k__BackingField - Entry: 9 - Data: 53 + Entry: 7 + Data: 87|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.PacManGhostFrozenState, Assembly-CSharp + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 53 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1732,7 +1738,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 87|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 88|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1753,25 +1759,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: frozenState + Data: hideUntilUnfrozen - Name: $v Entry: 7 - Data: 88|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: frozenState + Data: hideUntilUnfrozen - Name: k__BackingField - Entry: 7 - Data: 89|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.PacManGhostFrozenState, Assembly-CSharp - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1807,19 +1807,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: hideUntilUnfrozen + Data: housePelletCounter - Name: $v Entry: 7 Data: 91|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: hideUntilUnfrozen + Data: housePelletCounter - Name: k__BackingField Entry: 9 - Data: 53 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1855,19 +1855,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: housePelletCounter + Data: housePelletCounterActive - Name: $v Entry: 7 Data: 93|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: housePelletCounter + Data: housePelletCounterActive - Name: k__BackingField Entry: 9 - Data: 11 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1903,19 +1903,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: housePelletCounterActive + Data: turnAroundSoon - Name: $v Entry: 7 Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: housePelletCounterActive + Data: turnAroundSoon - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1946,54 +1946,6 @@ MonoBehaviour: - Name: Entry: 8 Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: turnAroundSoon - - Name: $v - Entry: 7 - Data: 97|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: turnAroundSoon - - Name: k__BackingField - Entry: 9 - Data: 53 - - Name: k__BackingField - Entry: 9 - Data: 53 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 98|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: Entry: 13 Data: diff --git a/Assets/Scripts/Ghost.cs b/Assets/Scripts/Ghost.cs index e657642..7ac8655 100644 --- a/Assets/Scripts/Ghost.cs +++ b/Assets/Scripts/Ghost.cs @@ -3,8 +3,6 @@ using UnityEngine; namespace Marro.PacManUdon { - - enum PacManGhostType { Caught, @@ -48,7 +46,6 @@ namespace Marro.PacManUdon private Vector3 startPosition; private Quaternion startRotation; - private Vector3 startScale; private Vector2 homePosition; private Vector2 idlePosition1; @@ -81,7 +78,7 @@ namespace Marro.PacManUdon private bool housePelletCounterActive; private bool turnAroundSoon; - public void Initialize(PacMan pacMan, Ghost blinky, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition) + public void Initialize(PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition) { ghostManager = transform.parent.GetComponent(); animator = GetComponent(); @@ -96,21 +93,16 @@ namespace Marro.PacManUdon scoreBonusDisplay = transform.Find("ScoreBonusDisplay").gameObject.GetComponent(); scoreBonusDisplay.Initialize(); - startPosition = transform.localPosition; - startRotation = transform.localRotation; - startScale = transform.localScale; + startPosition = startTransform.localPosition; + startRotation = startTransform.localRotation; frozenState = PacManGhostFrozenState.Frozen; - // Debug.Log($"{gameObject} Begin localScale = {initialScale}"); } public void Reset() { // Debug.Log($"{gameObject} Reset!"); - transform.localPosition = startPosition; - transform.localRotation = startRotation; - transform.localScale = startScale; - // Debug.Log($"{gameObject} Reset localScale = {transform.localScale}"); + transform.SetLocalPositionAndRotation(startPosition, startRotation); if (startState == PacManGhostStartState.Outside) { diff --git a/Assets/Scripts/GhostManager.cs b/Assets/Scripts/GhostManager.cs index 9628f75..2c7adb0 100644 --- a/Assets/Scripts/GhostManager.cs +++ b/Assets/Scripts/GhostManager.cs @@ -55,19 +55,20 @@ namespace Marro.PacManUdon private bool kinematic; // This should be called once when the game is initialized - public void Initialize(Transform[] ghostTargets, PacMan pacMan, GameManager gameController) + public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, GameManager gameController) { this.gameController = gameController; ghosts = transform.GetComponentsInChildren(true); blinky = ghosts[0]; for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++) { + Transform startTransform = ghostStarts[ghostIndex]; Vector2 homePosition = ghostTargets[0].localPosition; Vector2 idlePosition1 = ghostTargets[1 + ghostIndex * 3].localPosition; Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition; Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition; - ghosts[ghostIndex].Initialize(pacMan, blinky, homePosition, idlePosition1, idlePosition2, cornerPosition); + ghosts[ghostIndex].Initialize(pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition); } } diff --git a/Assets/Scripts/GridMover.cs b/Assets/Scripts/GridMover.cs index 7f46ac1..25a04be 100644 --- a/Assets/Scripts/GridMover.cs +++ b/Assets/Scripts/GridMover.cs @@ -1,9 +1,7 @@ namespace Marro.PacManUdon { using System; - using UdonSharp; using UnityEngine; - using VRC.Udon.Serialization.OdinSerializer; public abstract class GridMover : SyncedObject { diff --git a/Assets/Scripts/Maze.asset b/Assets/Scripts/Maze.asset index 002e6ee..4dc3d89 100644 --- a/Assets/Scripts/Maze.asset +++ b/Assets/Scripts/Maze.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 5 + Data: 6 - Name: Entry: 7 Data: @@ -283,25 +283,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: pacManStart + Data: ghostStarts - Name: $v Entry: 7 Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: pacManStart + Data: ghostStarts - Name: k__BackingField - Entry: 7 - Data: 18|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Transform, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 14 - Name: k__BackingField Entry: 9 - Data: 18 + Data: 14 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -316,13 +310,73 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 20|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 19|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: pacManStart + - Name: $v + Entry: 7 + Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: pacManStart + - Name: k__BackingField + Entry: 7 + Data: 21|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Transform, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 21 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 23|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: diff --git a/Assets/Scripts/Maze.cs b/Assets/Scripts/Maze.cs index 3479c18..0828c9b 100644 --- a/Assets/Scripts/Maze.cs +++ b/Assets/Scripts/Maze.cs @@ -1,16 +1,15 @@ -namespace Marro.PacManUdon -{ - using UdonSharp; - using UnityEngine; - using VRC.SDKBase; - using VRC.Udon; +using UdonSharp; +using UnityEngine; +namespace Marro.PacManUdon +{ public class Maze : UdonSharpBehaviour { [SerializeField] public Vector2 mazeBoundaries; [SerializeField] public GameObject pelletContainer; [SerializeField] public GameObject mazeSprite; [SerializeField] public Transform[] ghostTargets; + [SerializeField] public Transform[] ghostStarts; [SerializeField] public Transform pacManStart; } } \ No newline at end of file diff --git a/Assets/Scripts/NetworkManager.asset b/Assets/Scripts/NetworkManager.asset index 3883829..7952381 100644 --- a/Assets/Scripts/NetworkManager.asset +++ b/Assets/Scripts/NetworkManager.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 26 + Data: 28 - Name: Entry: 7 Data: @@ -637,19 +637,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsQueue + Data: eventsToSend - Name: $v Entry: 7 Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventsQueue + Data: eventsToSend - Name: k__BackingField Entry: 7 Data: 35|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Byte[][], mscorlib + Data: Marro.PacManUdon.NetworkEventType[], Assembly-CSharp - Name: Entry: 8 Data: @@ -658,7 +658,7 @@ MonoBehaviour: Data: 36|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Object[], mscorlib + Data: System.Int32[], mscorlib - Name: Entry: 8 Data: @@ -697,13 +697,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsQueueIndex + Data: eventsToSendIndex - Name: $v Entry: 7 Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventsQueueIndex + Data: eventsToSendIndex - Name: k__BackingField Entry: 9 Data: 11 @@ -745,10 +745,118 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsQueueIndexAtLastTransmission + Data: eventsQueue - Name: $v Entry: 7 Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventsQueue + - Name: k__BackingField + Entry: 7 + Data: 41|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Byte[][], mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 42|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Object[], mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 43|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: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventsQueueIndex + - Name: $v + Entry: 7 + Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventsQueueIndex + - Name: k__BackingField + Entry: 9 + Data: 11 + - Name: k__BackingField + Entry: 9 + Data: 11 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 45|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: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventsQueueIndexAtLastTransmission + - Name: $v + Entry: 7 + Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: eventsQueueIndexAtLastTransmission @@ -772,7 +880,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -796,22 +904,16 @@ MonoBehaviour: Data: eventTransmissionHistory - Name: $v Entry: 7 - Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: eventTransmissionHistory - Name: k__BackingField - Entry: 7 - Data: 43|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32[], mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 36 - Name: k__BackingField Entry: 9 - Data: 43 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -826,7 +928,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -850,7 +952,7 @@ MonoBehaviour: Data: eventTransmissionHistoryIndex - Name: $v Entry: 7 - Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: eventTransmissionHistoryIndex @@ -872,108 +974,6 @@ MonoBehaviour: - Name: k__BackingField Entry: 5 Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 46|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: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: lastEventTransmissionTime - - Name: $v - Entry: 7 - Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: lastEventTransmissionTime - - Name: k__BackingField - Entry: 9 - Data: 7 - - Name: k__BackingField - Entry: 9 - Data: 7 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 48|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: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: lastEventId - - Name: $v - Entry: 7 - Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: lastEventId - - Name: k__BackingField - Entry: 7 - Data: 50|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Byte, mscorlib - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 50 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - Name: _fieldAttributes Entry: 7 Data: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib @@ -997,16 +997,118 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: networkedData + Data: lastEventTransmissionTime - Name: $v Entry: 7 Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: lastEventTransmissionTime + - Name: k__BackingField + Entry: 9 + Data: 7 + - Name: k__BackingField + Entry: 9 + Data: 7 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 53|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: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: lastEventId + - Name: $v + Entry: 7 + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: lastEventId + - Name: k__BackingField + Entry: 7 + Data: 55|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Byte, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 55 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 56|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: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: networkedData + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: networkedData - Name: k__BackingField Entry: 7 - Data: 53|System.RuntimeType, mscorlib + Data: 58|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Byte[], mscorlib @@ -1015,7 +1117,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 53 + Data: 58 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1030,13 +1132,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 55|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 60|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -1060,7 +1162,7 @@ MonoBehaviour: Data: k__BackingField - Name: $v Entry: 7 - Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: k__BackingField @@ -1084,7 +1186,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1108,7 +1210,7 @@ MonoBehaviour: Data: k__BackingField - Name: $v Entry: 7 - Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: k__BackingField @@ -1132,7 +1234,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1156,7 +1258,7 @@ MonoBehaviour: Data: k__BackingField - Name: $v Entry: 7 - Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: k__BackingField @@ -1180,7 +1282,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1204,7 +1306,7 @@ MonoBehaviour: Data: k__BackingField - Name: $v Entry: 7 - Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: k__BackingField @@ -1228,7 +1330,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1252,7 +1354,7 @@ MonoBehaviour: Data: k__BackingField - Name: $v Entry: 7 - Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: k__BackingField @@ -1276,7 +1378,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 70|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1300,7 +1402,7 @@ MonoBehaviour: Data: k__BackingField - Name: $v Entry: 7 - Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: k__BackingField @@ -1324,7 +1426,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1348,13 +1450,13 @@ MonoBehaviour: Data: DebugImageToIndicateOwner - Name: $v Entry: 7 - Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: DebugImageToIndicateOwner - Name: k__BackingField Entry: 7 - Data: 69|System.RuntimeType, mscorlib + Data: 74|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Animator, UnityEngine.AnimationModule @@ -1363,7 +1465,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 69 + Data: 74 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1378,13 +1480,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 70|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 75|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 71|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 76|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: diff --git a/Assets/Scripts/NetworkManager.cs b/Assets/Scripts/NetworkManager.cs index ea80520..5daed89 100644 --- a/Assets/Scripts/NetworkManager.cs +++ b/Assets/Scripts/NetworkManager.cs @@ -122,6 +122,15 @@ namespace Marro.PacManUdon /// private bool serializationRequested; + /// + /// Events to send at the end of SyncedUpdate cycle + /// + private NetworkEventType[] eventsToSend; + /// + /// Index for + /// + private int eventsToSendIndex; + /// /// Queue of events to be transmitted or processed. /// @@ -267,6 +276,11 @@ namespace Marro.PacManUdon // Forwards simulated time at the FixedUpdate pace PerformFixedSyncedUpdate(); + + if (IsOwner) + { + ProcessEventsToSend(); + } } private void UpdateInternalTime() @@ -316,7 +330,7 @@ namespace Marro.PacManUdon } else { - SendEvent(NetworkEventType.FullSyncForced); + SendEventSoon(NetworkEventType.FullSyncForced); } } @@ -332,7 +346,7 @@ namespace Marro.PacManUdon #endregion #region Sender - public void SendEvent(NetworkEventType eventType) + public void SendEventSoon(NetworkEventType eventType) { if (!Ready) { @@ -341,7 +355,40 @@ namespace Marro.PacManUdon if (!IsOwner) { - Debug.LogError($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Attempted {nameof(SendEvent)} while not the owner!"); + Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Attempted {nameof(SendEventSoon)} while not the owner!"); + return; + } + + if (eventsQueueIndex > eventsToSend.Length) + { + Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSend)} overflow!"); + HandleError(false); + return; + } + + eventsToSend[eventsToSendIndex++] = eventType; + } + + private void ProcessEventsToSend() + { + for (int i = 0; i < eventsToSendIndex; i++) + { + SendEventNow(eventsToSend[0]); + } + + eventsToSendIndex = 0; + } + + public void SendEventNow(NetworkEventType eventType) + { + if (!Ready) + { + return; + } + + if (!IsOwner) + { + Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Attempted {nameof(SendEventNow)} while not the owner!"); return; } @@ -426,10 +473,11 @@ namespace Marro.PacManUdon if (eventType == NetworkEventType.FullSyncForced) { - SendEvent(NetworkEventType.FullSync); // Remote is not allowed to request a forced full sync + SendEventSoon(NetworkEventType.FullSync); // Remote is not allowed to request a forced full sync + return; } - SendEvent(eventType); + SendEventSoon(eventType); } private void ProgressPingTime() @@ -587,6 +635,7 @@ namespace Marro.PacManUdon if (Synced) { + Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)} blaat"); UpdateNextEventTime(); } } @@ -619,6 +668,7 @@ namespace Marro.PacManUdon } DequeueEventsFromBuffer(1); + Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)} damn"); UpdateNextEventTime(); } } @@ -693,10 +743,14 @@ namespace Marro.PacManUdon { eventsQueue = new byte[BufferMaxTotalEvents][]; eventsQueueIndex = 0; + lastEventId = 0; + hasFullSyncReady = false; + eventTransmissionHistory = new int[maxEventSendTries]; eventTransmissionHistoryIndex = 0; eventsQueueIndexAtLastTransmission = 0; - lastEventId = 0; + eventsToSend = new NetworkEventType[BufferMaxTotalEvents]; + eventsToSendIndex = 0; } private void DequeueEventsFromBuffer(int eventCount) @@ -822,7 +876,7 @@ namespace Marro.PacManUdon if (newOwnerIsLocalPlayer) { - SendEvent(NetworkEventType.FullSyncForced); + SendEventSoon(NetworkEventType.FullSyncForced); } } #endregion @@ -919,7 +973,7 @@ namespace Marro.PacManUdon public void DoFullSync() { - SendEvent(NetworkEventType.FullSync); + SendEventSoon(NetworkEventType.FullSync); } #endregion } diff --git a/Assets/Scripts/PacMan.asset b/Assets/Scripts/PacMan.asset index 4d9542e..728db28 100644 --- a/Assets/Scripts/PacMan.asset +++ b/Assets/Scripts/PacMan.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 21 + Data: 20 - Name: Entry: 7 Data: @@ -529,64 +529,16 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: startScale + Data: animator - Name: $v Entry: 7 Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: startScale - - Name: k__BackingField - Entry: 9 - Data: 23 - - Name: k__BackingField - Entry: 9 - Data: 23 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 29|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: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: animator - - Name: $v - Entry: 7 - Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: animator - Name: k__BackingField Entry: 7 - Data: 31|System.RuntimeType, mscorlib + Data: 29|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Animator, UnityEngine.AnimationModule @@ -595,7 +547,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 31 + Data: 29 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -610,7 +562,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -634,13 +586,13 @@ MonoBehaviour: Data: renderer - Name: $v Entry: 7 - Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: renderer - Name: k__BackingField Entry: 7 - Data: 34|System.RuntimeType, mscorlib + Data: 32|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Renderer, UnityEngine.CoreModule @@ -649,7 +601,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 34 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -664,7 +616,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -688,13 +640,13 @@ MonoBehaviour: Data: hideUntilUnfrozen - Name: $v Entry: 7 - Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: hideUntilUnfrozen - Name: k__BackingField Entry: 7 - Data: 37|System.RuntimeType, mscorlib + Data: 35|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Boolean, mscorlib @@ -703,7 +655,55 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 37 + Data: 35 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 36|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: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: dead + - Name: $v + Entry: 7 + Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: dead + - Name: k__BackingField + Entry: 9 + Data: 35 + - Name: k__BackingField + Entry: 9 + Data: 35 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -739,19 +739,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: dead + Data: kinematic - Name: $v Entry: 7 Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: dead + Data: kinematic - Name: k__BackingField Entry: 9 - Data: 37 + Data: 35 - Name: k__BackingField Entry: 9 - Data: 37 + Data: 35 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -787,19 +787,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: kinematic + Data: followingPredefinedPath - Name: $v Entry: 7 Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: kinematic + Data: followingPredefinedPath - Name: k__BackingField Entry: 9 - Data: 37 + Data: 35 - Name: k__BackingField Entry: 9 - Data: 37 + Data: 35 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -835,64 +835,16 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: followingPredefinedPath + Data: predefinedPath - Name: $v Entry: 7 Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: followingPredefinedPath - - Name: k__BackingField - Entry: 9 - Data: 37 - - Name: k__BackingField - Entry: 9 - Data: 37 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 44|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: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: predefinedPath - - Name: $v - Entry: 7 - Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: predefinedPath - Name: k__BackingField Entry: 7 - Data: 46|System.RuntimeType, mscorlib + Data: 44|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Vector2[], UnityEngine.CoreModule @@ -901,7 +853,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 46 + Data: 44 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -916,7 +868,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -940,13 +892,13 @@ MonoBehaviour: Data: predefinedPathIndex - Name: $v Entry: 7 - Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: predefinedPathIndex - Name: k__BackingField Entry: 7 - Data: 49|System.RuntimeType, mscorlib + Data: 47|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Int32, mscorlib @@ -955,7 +907,55 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 49 + Data: 47 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 48|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: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: targetDirection + - Name: $v + Entry: 7 + Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: targetDirection + - Name: k__BackingField + Entry: 9 + Data: 7 + - Name: k__BackingField + Entry: 9 + Data: 7 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -991,19 +991,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: targetDirection + Data: freezeSeconds - Name: $v Entry: 7 Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: targetDirection + Data: freezeSeconds - Name: k__BackingField Entry: 9 - Data: 7 + Data: 16 - Name: k__BackingField Entry: 9 - Data: 7 + Data: 16 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1039,19 +1039,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: freezeSeconds + Data: frozen - Name: $v Entry: 7 Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: freezeSeconds + Data: frozen - Name: k__BackingField Entry: 9 - Data: 16 + Data: 35 - Name: k__BackingField Entry: 9 - Data: 16 + Data: 35 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1082,54 +1082,6 @@ MonoBehaviour: - Name: Entry: 8 Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: frozen - - Name: $v - Entry: 7 - Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: frozen - - Name: k__BackingField - Entry: 9 - Data: 37 - - Name: k__BackingField - Entry: 9 - Data: 37 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 56|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: Entry: 13 Data: diff --git a/Assets/Scripts/PacMan.cs b/Assets/Scripts/PacMan.cs index 12a3a8a..e04ca27 100644 --- a/Assets/Scripts/PacMan.cs +++ b/Assets/Scripts/PacMan.cs @@ -1,7 +1,5 @@ using System; using UnityEngine; -using VRC.SDK3.Components; -using VRC.SDKBase; namespace Marro.PacManUdon { @@ -16,7 +14,6 @@ namespace Marro.PacManUdon private float speed; private Vector3 startPosition; private Quaternion startRotation; - private Vector3 startScale; private Animator animator; new Renderer renderer; private bool hideUntilUnfrozen; @@ -53,13 +50,11 @@ namespace Marro.PacManUdon hideUntilUnfrozen = false; startPosition = startTransform.localPosition; startRotation = startTransform.localRotation; - startScale = startTransform.localScale; } public void Reset() { transform.SetLocalPositionAndRotation(startPosition, startRotation); - transform.localScale = startScale; direction = Vector2.left; targetDirection = Vector2.left; speed = defaultSpeed; @@ -156,7 +151,7 @@ namespace Marro.PacManUdon SetDirection(inputDirection + new Vector2(GridMoverTools.PositionToGrid(nextPosition).x - nextPosition.x, 0).normalized); } SetTargetDirection(inputDirection); // This is the direction most logic should assume pacman is moving, the actual direction may be different due to cornering - networkManager.SendEvent(NetworkEventType.PacManTurn); + networkManager.SendEventSoon(NetworkEventType.PacManTurn); } return nextPosition; diff --git a/Assets/Scripts/Sequences/StartNewGame.cs b/Assets/Scripts/Sequences/StartNewGame.cs index 0285b59..150c2e1 100644 --- a/Assets/Scripts/Sequences/StartNewGame.cs +++ b/Assets/Scripts/Sequences/StartNewGame.cs @@ -1,5 +1,3 @@ -using UnityEngine; - namespace Marro.PacManUdon { public partial class GameManager diff --git a/Assets/Scripts/Sequences/TimeSequenceShared.cs b/Assets/Scripts/Sequences/TimeSequenceShared.cs index 7dbb9f7..38a8a02 100644 --- a/Assets/Scripts/Sequences/TimeSequenceShared.cs +++ b/Assets/Scripts/Sequences/TimeSequenceShared.cs @@ -1,7 +1,4 @@ -using UdonSharp; using UnityEngine; -using VRC.SDKBase; -using VRC.SDK3.Data; namespace Marro.PacManUdon { @@ -59,7 +56,7 @@ namespace Marro.PacManUdon private void TimeSequenceSkipToNextStep() { - Debug.Log($"{gameObject} TimeSequenceSkipToNextStep"); + Debug.Log($"{gameObject} TimeSequenceSkipToNextStep"); if (timeSequenceProgress < timeSequenceKeyframeTimes.Length) { TimeSequenceProgressToTime(timeSequenceKeyframeTimes[timeSequenceProgress]); @@ -94,10 +91,10 @@ namespace Marro.PacManUdon //{ Debug.LogWarning($"{gameObject} TimeSequencePrepareForFinish"); TimeSequenceExecuteFinalize(timeSequence); - if (!jumpingToTimeSequence) - { - TimeSequenceExecuteFinished(timeSequence); - } + if (!jumpingToTimeSequence) + { + TimeSequenceExecuteFinished(timeSequence); + } //} //else //{ @@ -138,7 +135,7 @@ namespace Marro.PacManUdon //} #region Events - + public void JumpToTimeSequenceAttractScreenIntroduction() { StartTimeSequence(PacManTimeSequence.AttractScreenIntroduction); @@ -247,7 +244,7 @@ namespace Marro.PacManUdon private void TimeSequenceExecuteStep(PacManTimeSequence timeSequence, int sequenceProgress) { - Debug.Log($"{gameObject} Triggered time sequence step for sequence {currentTimeSequence} with progress {sequenceProgress}"); + Debug.Log($"{gameObject} Triggered time sequence step for sequence {currentTimeSequence} with progress {sequenceProgress}"); switch (timeSequence) { default: @@ -301,7 +298,7 @@ namespace Marro.PacManUdon private void TimeSequenceExecuteFinalize(PacManTimeSequence timeSequence) { - Debug.Log($"{gameObject} Triggered time sequence finalize for sequence {currentTimeSequence}"); + Debug.Log($"{gameObject} Triggered time sequence finalize for sequence {currentTimeSequence}"); switch (timeSequence) { default: diff --git a/Assets/Test stuff/TestBallManager.cs b/Assets/Test stuff/TestBallManager.cs index 4c2fb49..c8bf63d 100644 --- a/Assets/Test stuff/TestBallManager.cs +++ b/Assets/Test stuff/TestBallManager.cs @@ -49,7 +49,7 @@ public class TestBallManager : UdonSharpBehaviour testBall.UpButtonPressed(); } - networkManager.SendEvent(NetworkEventType.PacManTurn); + networkManager.SendEventSoon(NetworkEventType.PacManTurn); } public void SyncButtonPressed() @@ -60,7 +60,7 @@ public class TestBallManager : UdonSharpBehaviour } else if (networkManager.IsOwner) { - networkManager.SendEvent(NetworkEventType.FullSync); + networkManager.SendEventSoon(NetworkEventType.FullSync); } else {