From 1433b9bdfc5b35f78515326453f9b6d742f5e017 Mon Sep 17 00:00:00 2001 From: Marro64 Date: Sat, 24 Jan 2026 15:04:54 +0100 Subject: [PATCH] Ghosts synced with some issues --- Assets/Scenes/PacMan.unity | 270 ++- Assets/Scripts/ByteUtils.cs | 16 +- Assets/Scripts/GameManager.asset | 1713 ++++++++--------- Assets/Scripts/GameManager.cs | 65 +- Assets/Scripts/Ghost.asset | 50 +- Assets/Scripts/Ghost.cs | 18 +- Assets/Scripts/GhostManager.asset | 378 ++-- Assets/Scripts/GhostManager.cs | 125 +- Assets/Scripts/GridMover.cs | 10 - Assets/Scripts/NetworkManager.cs | 10 +- .../Sequences/AttractScreenIntroduction.cs | 2 +- 11 files changed, 1489 insertions(+), 1168 deletions(-) diff --git a/Assets/Scenes/PacMan.unity b/Assets/Scenes/PacMan.unity index 73173b1..cabb287 100644 --- a/Assets/Scenes/PacMan.unity +++ b/Assets/Scenes/PacMan.unity @@ -9746,6 +9746,7 @@ RectTransform: - {fileID: 223918359} - {fileID: 1673553851} - {fileID: 1837547959} + - {fileID: 1437073246} m_Father: {fileID: 653732755} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} @@ -32392,6 +32393,140 @@ Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} m_PrefabInstance: {fileID: 1547903860} m_PrefabAsset: {fileID: 0} +--- !u!1 &1035743220 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1035743221} + - component: {fileID: 1035743223} + - component: {fileID: 1035743222} + m_Layer: 0 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1035743221 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1035743220} + 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: 1437073246} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1035743222 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1035743220} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Pellet Sync + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1035743223 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1035743220} + m_CullTransparentMesh: 1 --- !u!1 &1036453362 GameObject: m_ObjectHideFlags: 0 @@ -46008,6 +46143,139 @@ Transform: m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} m_PrefabInstance: {fileID: 1628865249} m_PrefabAsset: {fileID: 0} +--- !u!1 &1437073245 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1437073246} + - component: {fileID: 1437073249} + - component: {fileID: 1437073248} + - component: {fileID: 1437073247} + m_Layer: 0 + m_Name: Ghost Sync + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1437073246 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437073245} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.0000006170327} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1035743221} + m_Father: {fileID: 291096817} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 138.00223, y: 50.000023} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1437073247 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437073245} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1437073248} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 811840792} + m_TargetAssemblyTypeName: + m_MethodName: SendCustomEvent + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: DoGhostSync + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &1437073248 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437073245} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 35630e38b4e5ffb40b44ec5348b4333f, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1437073249 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437073245} + m_CullTransparentMesh: 1 --- !u!1 &1438618202 GameObject: m_ObjectHideFlags: 0 @@ -55122,10 +55390,10 @@ MonoBehaviour: DynamicMaterials: - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 2541243872366204002, guid: 7168d13094fcae94b81e672d1f4ab73f, type: 2} - - {fileID: 2100000, guid: fc67956adbc95584ba3ae3b18d1e430d, type: 2} - {fileID: 10758, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 2100000, guid: a3869014ba4893d409f150224856180a, type: 2} + - {fileID: 2100000, guid: fc67956adbc95584ba3ae3b18d1e430d, type: 2} - {fileID: 2100000, guid: ae0c7562e66fca1469f7ee603e462581, type: 2} - {fileID: 2100000, guid: db2b6d76bdd134244912a5c1c9971804, type: 2} LightMapsNear: [] diff --git a/Assets/Scripts/ByteUtils.cs b/Assets/Scripts/ByteUtils.cs index 7c3945d..a8e6ca0 100644 --- a/Assets/Scripts/ByteUtils.cs +++ b/Assets/Scripts/ByteUtils.cs @@ -19,7 +19,7 @@ namespace Marro.PacManUdon target[index++] = (byte)value; public static void Append(this byte[] target, bool value, ref int index) => - target[index++] = value ? (byte)1 : (byte)1; + target[index++] = value ? (byte)1 : (byte)0; public static void Append(this byte[] target, ushort value, ref int index) => target.Append(BitConverter.GetBytes(value), ref index); @@ -33,6 +33,13 @@ namespace Marro.PacManUdon public static void Append(this byte[] target, int value, ref int index) => target.Append(BitConverter.GetBytes(value), ref index); + /// + /// Casts to a byte and then appends it. + /// Safer than doing Append((byte)value, ref index), which can crash the Udonbehaviour. + /// + public static void AppendAsByte(this byte[] target, int value, ref int index) => + target.Append(value.ToByte(), ref index); + public static void Append(this byte[] target, ulong value, ref int index) => target.Append(BitConverter.GetBytes(value), ref index); @@ -143,5 +150,12 @@ namespace Marro.PacManUdon index += 12; return value; } + + /// + /// Casts an Int32 to a byte. + /// Doing this inline sometimes causes an udon exception, but doing it via a separate method seems to work fine. + /// + public static byte ToByte(this int value) => + (byte)value; } } \ No newline at end of file diff --git a/Assets/Scripts/GameManager.asset b/Assets/Scripts/GameManager.asset index 51a9bc1..3ff7e20 100644 --- a/Assets/Scripts/GameManager.asset +++ b/Assets/Scripts/GameManager.asset @@ -109,382 +109,16 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: currentlyInTimeSequence + Data: mazes - Name: $v Entry: 7 Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: currentlyInTimeSequence + Data: mazes - Name: k__BackingField Entry: 7 Data: 7|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Boolean, mscorlib - - Name: - Entry: 8 - Data: - - 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: 8|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: waitingForTimeSequenceFinalize - - Name: $v - Entry: 7 - Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: waitingForTimeSequenceFinalize - - 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: 10|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: jumpingToTimeSequence - - Name: $v - Entry: 7 - Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: jumpingToTimeSequence - - 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: 12|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: currentTimeSequence - - Name: $v - Entry: 7 - Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: currentTimeSequence - - Name: k__BackingField - Entry: 7 - Data: 14|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.PacManTimeSequence, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 7 - Data: 15|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, 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: 16|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: timeSequenceSecondsPassed - - Name: $v - Entry: 7 - Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: timeSequenceSecondsPassed - - Name: k__BackingField - Entry: 7 - Data: 18|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Single, mscorlib - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 18 - - 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: 19|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: timeSequenceProgress - - Name: $v - Entry: 7 - Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: timeSequenceProgress - - Name: k__BackingField - Entry: 9 - Data: 15 - - Name: k__BackingField - Entry: 9 - Data: 15 - - 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: 21|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: timeSequenceKeyframeTimes - - Name: $v - Entry: 7 - Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: timeSequenceKeyframeTimes - - Name: k__BackingField - Entry: 7 - Data: 23|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Single[], mscorlib - - Name: - Entry: 8 - Data: - - 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: 24|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: mazes - - Name: $v - Entry: 7 - Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: mazes - - Name: k__BackingField - Entry: 7 - Data: 26|System.RuntimeType, mscorlib - Name: Entry: 1 Data: Marro.PacManUdon.Maze[], Assembly-CSharp @@ -493,7 +127,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 7 - Data: 27|System.RuntimeType, mscorlib + Data: 8|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Component[], UnityEngine.CoreModule @@ -514,13 +148,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 29|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + Data: 10|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - Name: header Entry: 1 Data: Static game components @@ -529,7 +163,7 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 30|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 11|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -553,13 +187,13 @@ MonoBehaviour: Data: pacMan - Name: $v Entry: 7 - Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: pacMan - Name: k__BackingField Entry: 7 - Data: 32|System.RuntimeType, mscorlib + Data: 13|System.RuntimeType, mscorlib - Name: Entry: 1 Data: Marro.PacManUdon.PacMan, Assembly-CSharp @@ -581,6 +215,300 @@ MonoBehaviour: - Name: k__BackingField Entry: 5 Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 15|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: ghostManager + - Name: $v + Entry: 7 + Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ghostManager + - Name: k__BackingField + Entry: 7 + Data: 17|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.GhostManager, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 4 + - 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: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + 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: bonusFruit + - Name: $v + Entry: 7 + Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: bonusFruit + - Name: k__BackingField + Entry: 7 + Data: 21|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 4 + - 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: + - 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: pelletManager + - Name: $v + Entry: 7 + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: pelletManager + - Name: k__BackingField + Entry: 7 + Data: 25|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.PelletManager, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 4 + - 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: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 27|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: statusDisplay + - Name: $v + Entry: 7 + Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: statusDisplay + - Name: k__BackingField + Entry: 7 + Data: 29|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.StatusDisplay, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 4 + - 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: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 31|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: attractScreen + - Name: $v + Entry: 7 + Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: attractScreen + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 4 + - 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: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib @@ -610,25 +538,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: ghostManager + Data: intermissionScreen - Name: $v Entry: 7 Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: ghostManager + Data: intermissionScreen - Name: k__BackingField Entry: 7 Data: 36|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.GhostManager, Assembly-CSharp + Data: UnityEngine.GameObject, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 4 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -670,25 +598,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: bonusFruit + Data: pressStartButtonScreen - Name: $v Entry: 7 Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: bonusFruit + Data: pressStartButtonScreen - Name: k__BackingField - Entry: 7 - Data: 40|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 36 - Name: k__BackingField Entry: 9 - Data: 4 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -703,13 +625,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 42|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 41|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -730,19 +652,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: pelletManager + Data: playerInput - Name: $v Entry: 7 - Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: pelletManager + Data: playerInput - Name: k__BackingField Entry: 7 - Data: 44|System.RuntimeType, mscorlib + Data: 43|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.PelletManager, Assembly-CSharp + Data: Marro.PacManUdon.PlayerInput, Assembly-CSharp - Name: Entry: 8 Data: @@ -763,13 +685,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 46|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 45|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -790,25 +712,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: statusDisplay + Data: demo - Name: $v Entry: 7 - Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: statusDisplay + Data: demo - Name: k__BackingField Entry: 7 - Data: 48|System.RuntimeType, mscorlib + Data: 47|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.StatusDisplay, Assembly-CSharp + Data: UnityEngine.Animator, UnityEngine.AnimationModule - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 4 + Data: 47 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -823,13 +745,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 50|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 49|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -850,16 +772,22 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: attractScreen + Data: soundManager - Name: $v Entry: 7 - Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: attractScreen + Data: soundManager - Name: k__BackingField - Entry: 9 - Data: 44 + Entry: 7 + Data: 51|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: SoundManager, Assembly-CSharp + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 Data: 4 @@ -902,306 +830,12 @@ MonoBehaviour: - Name: Entry: 7 Data: - - Name: $k - Entry: 1 - Data: intermissionScreen - - Name: $v - Entry: 7 - Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: intermissionScreen - - Name: k__BackingField - Entry: 7 - Data: 55|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.GameObject, UnityEngine.CoreModule - - 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: true - - Name: _fieldAttributes - Entry: 7 - Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 57|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: pressStartButtonScreen - - Name: $v - Entry: 7 - Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: pressStartButtonScreen - - Name: k__BackingField - Entry: 9 - Data: 55 - - 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: true - - Name: _fieldAttributes - Entry: 7 - Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 60|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: playerInput - - Name: $v - Entry: 7 - Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: playerInput - - Name: k__BackingField - Entry: 7 - Data: 62|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.PlayerInput, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 4 - - 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: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 64|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: demo - - Name: $v - Entry: 7 - Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: demo - - Name: k__BackingField - Entry: 7 - Data: 66|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Animator, UnityEngine.AnimationModule - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 66 - - 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: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 68|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: soundManager - - Name: $v - Entry: 7 - Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: soundManager - - Name: k__BackingField - Entry: 7 - Data: 70|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: SoundManager, Assembly-CSharp - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 4 - - 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: 71|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 72|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: networkManagerSetup - Name: $v Entry: 7 - Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: networkManagerSetup @@ -1225,13 +859,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 75|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 56|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -1255,16 +889,16 @@ MonoBehaviour: Data: recorder - Name: $v Entry: 7 - Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: recorder - Name: k__BackingField Entry: 9 - Data: 55 + Data: 36 - Name: k__BackingField Entry: 9 - Data: 55 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1279,13 +913,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 78|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 59|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -1309,16 +943,22 @@ MonoBehaviour: Data: startingExtraLives - Name: $v Entry: 7 - Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: startingExtraLives - Name: k__BackingField - Entry: 9 - Data: 15 + Entry: 7 + Data: 61|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 15 + Data: 61 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1333,13 +973,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 80|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 81|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + Data: 63|UnityEngine.HeaderAttribute, UnityEngine.CoreModule - Name: header Entry: 1 Data: Game settings @@ -1348,7 +988,7 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 82|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 64|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -1372,16 +1012,16 @@ MonoBehaviour: Data: scoreToExtraLife - Name: $v Entry: 7 - Data: 83|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: scoreToExtraLife - Name: k__BackingField Entry: 9 - Data: 15 + Data: 61 - Name: k__BackingField Entry: 9 - Data: 15 + Data: 61 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1396,13 +1036,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 84|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 85|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 67|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -1426,13 +1066,13 @@ MonoBehaviour: Data: maze - Name: $v Entry: 7 - Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: maze - Name: k__BackingField Entry: 7 - Data: 87|System.RuntimeType, mscorlib + Data: 69|System.RuntimeType, mscorlib - Name: Entry: 1 Data: Marro.PacManUdon.Maze, Assembly-CSharp @@ -1456,7 +1096,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 88|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 @@ -1480,13 +1120,13 @@ MonoBehaviour: Data: intermission2Pole - Name: $v Entry: 7 - Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: intermission2Pole - Name: k__BackingField Entry: 7 - Data: 90|System.RuntimeType, mscorlib + Data: 72|System.RuntimeType, mscorlib - Name: Entry: 1 Data: Marro.PacManUdon.Intermission2Pole, Assembly-CSharp @@ -1508,6 +1148,402 @@ MonoBehaviour: - Name: k__BackingField Entry: 5 Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 73|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: mazeSpriteAnimator + - Name: $v + Entry: 7 + Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: mazeSpriteAnimator + - Name: k__BackingField + Entry: 9 + Data: 47 + - Name: k__BackingField + Entry: 9 + 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: 75|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: attractScreenElements + - Name: $v + Entry: 7 + Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: attractScreenElements + - Name: k__BackingField + Entry: 7 + Data: 77|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.GameObject[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 77 + - 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: 78|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: intermissionScreenElements + - Name: $v + Entry: 7 + Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: intermissionScreenElements + - Name: k__BackingField + Entry: 9 + Data: 77 + - Name: k__BackingField + Entry: 9 + Data: 77 + - 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: 80|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: gameState + - Name: $v + Entry: 7 + Data: 81|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: gameState + - Name: k__BackingField + Entry: 7 + Data: 82|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.PacManGameState, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 61 + - 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: 83|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: score + - Name: $v + Entry: 7 + Data: 84|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: score + - Name: k__BackingField + Entry: 9 + Data: 61 + - Name: k__BackingField + Entry: 9 + Data: 61 + - 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: 85|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: level + - Name: $v + Entry: 7 + Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: level + - Name: k__BackingField + Entry: 9 + Data: 61 + - Name: k__BackingField + Entry: 9 + Data: 61 + - 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: 87|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: highScore + - Name: $v + Entry: 7 + Data: 88|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: highScore + - Name: k__BackingField + Entry: 9 + Data: 61 + - Name: k__BackingField + Entry: 9 + Data: 61 + - 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: 89|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: extraLives + - Name: $v + Entry: 7 + Data: 90|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: extraLives + - Name: k__BackingField + Entry: 9 + Data: 61 + - Name: k__BackingField + Entry: 9 + Data: 61 + - 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: 91|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib @@ -1531,19 +1567,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: mazeSpriteAnimator + Data: currentlyInTimeSequence - Name: $v Entry: 7 Data: 92|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: mazeSpriteAnimator + Data: currentlyInTimeSequence - Name: k__BackingField - Entry: 9 - Data: 66 + Entry: 7 + Data: 93|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 66 + Data: 93 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1558,7 +1600,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 93|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 94|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1579,25 +1621,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: attractScreenElements + Data: waitingForTimeSequenceFinalize - Name: $v Entry: 7 - Data: 94|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: attractScreenElements + Data: waitingForTimeSequenceFinalize - Name: k__BackingField - Entry: 7 - Data: 95|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.GameObject[], UnityEngine.CoreModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 93 - Name: k__BackingField Entry: 9 - Data: 95 + Data: 93 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1633,19 +1669,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: intermissionScreenElements + Data: jumpingToTimeSequence - Name: $v Entry: 7 Data: 97|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: intermissionScreenElements + Data: jumpingToTimeSequence - Name: k__BackingField Entry: 9 - Data: 95 + Data: 93 - Name: k__BackingField Entry: 9 - Data: 95 + Data: 93 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1681,25 +1717,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: gameState + Data: currentTimeSequence - Name: $v Entry: 7 Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: gameState + Data: currentTimeSequence - Name: k__BackingField Entry: 7 Data: 100|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.PacManGameState, Assembly-CSharp + Data: Marro.PacManUdon.PacManTimeSequence, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 15 + Data: 61 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1736,25 +1772,31 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: score + Data: timeSequenceSecondsPassed - Name: $v Entry: 7 Data: 102|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: score + Data: timeSequenceSecondsPassed - Name: k__BackingField - Entry: 9 - Data: 15 + Entry: 7 + Data: 103|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 15 + Data: 103 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - Name: - Entry: 3 - Data: 1 + Entry: 6 + Data: - Name: Entry: 8 Data: @@ -1763,23 +1805,11 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 103|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], + Data: 104|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 104|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 105|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: + Data: 0 - Name: Entry: 13 Data: @@ -1797,25 +1827,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: level + Data: timeSequenceProgress - Name: $v Entry: 7 - Data: 106|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 105|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: level + Data: timeSequenceProgress - Name: k__BackingField Entry: 9 - Data: 15 + Data: 61 - Name: k__BackingField Entry: 9 - Data: 15 + Data: 61 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - Name: - Entry: 3 - Data: 1 + Entry: 6 + Data: - Name: Entry: 8 Data: @@ -1824,23 +1854,11 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 107|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], + Data: 106|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 108|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 109|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: + Data: 0 - Name: Entry: 13 Data: @@ -1858,25 +1876,31 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: highScore + Data: timeSequenceKeyframeTimes - Name: $v Entry: 7 - Data: 110|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 107|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: highScore + Data: timeSequenceKeyframeTimes - Name: k__BackingField - Entry: 9 - Data: 15 + Entry: 7 + Data: 108|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single[], mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 15 + Data: 108 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - Name: - Entry: 3 - Data: 1 + Entry: 6 + Data: - Name: Entry: 8 Data: @@ -1885,84 +1909,11 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 111|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], + Data: 109|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 112|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 113|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime - - 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: extraLives - - Name: $v - Entry: 7 - Data: 114|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: extraLives - - Name: k__BackingField - Entry: 9 - Data: 15 - - Name: k__BackingField - Entry: 9 - Data: 15 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 3 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 115|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], - mscorlib - - Name: - Entry: 12 - Data: 2 - - Name: - Entry: 7 - Data: 116|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: 117|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime - - Name: - Entry: 8 - Data: + Data: 0 - Name: Entry: 13 Data: diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 7152d5b..3936101 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -22,7 +22,6 @@ namespace Marro.PacManUdon [SerializeField] private GameObject recorder; - [Header("Game settings")] [SerializeField] private int startingExtraLives = 3; [SerializeField] private int scoreToExtraLife = 10000; @@ -35,10 +34,10 @@ namespace Marro.PacManUdon private GameObject[] intermissionScreenElements; private PacManGameState gameState; - [UdonSynced, FieldChangeCallback(nameof(Score))] private int score; - [UdonSynced, FieldChangeCallback(nameof(Level))] private int level; - [UdonSynced, FieldChangeCallback(nameof(HighScore))] private int highScore; - [UdonSynced, FieldChangeCallback(nameof(ExtraLives))] private int extraLives; + private int score; + private int level; + private int highScore; + private int extraLives; public void Start() { @@ -147,7 +146,7 @@ namespace Marro.PacManUdon // SetInGameComponentVisibility(true); - ghostManager.Reset(afterLifeLost); + ghostManager.RestartLevel(afterLifeLost); pacMan.Reset(); bonusFruit.Despawn(); soundManager.Reset(); @@ -421,58 +420,8 @@ namespace Marro.PacManUdon return true; } - public int ExtraLives - { - set - { - SetExtraLives(value); - } - get => extraLives; - } + public PacManGameState GameState => gameState; - public PacManGameState GameState - { - set - { - SetGameState(value); - } - get => gameState; - } - - public bool GhostsScared - { - set - { - - } - get => GhostsScared; - } - - public int Score - { - set - { - SetScore(value); - } - get => score; - } - - public int HighScore - { - set - { - SetHighScore(value); - } - get => score; - } - - public int Level - { - set - { - SetLevel(value); - } - get => level; - } + public int Level => level; } } \ No newline at end of file diff --git a/Assets/Scripts/Ghost.asset b/Assets/Scripts/Ghost.asset index da62ab4..a9d6d3a 100644 --- a/Assets/Scripts/Ghost.asset +++ b/Assets/Scripts/Ghost.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 36 + Data: 37 - Name: Entry: 7 Data: @@ -1898,6 +1898,54 @@ MonoBehaviour: - Name: Entry: 8 Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: k__BackingField + - Name: $v + Entry: 7 + Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - 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: 96|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 6497015..85d601a 100644 --- a/Assets/Scripts/Ghost.cs +++ b/Assets/Scripts/Ghost.cs @@ -85,7 +85,10 @@ namespace Marro.PacManUdon private Vector2[] predefinedPath; private int predefinedPathIndex; - public void Initialize(PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition) + public bool IsScared => isScared; + public int Index { get; private set; } + + public void Initialize(PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition, int index) { ghostManager = transform.parent.GetComponent(); animator = GetComponent(); @@ -104,6 +107,8 @@ namespace Marro.PacManUdon startRotation = startTransform.localRotation; frozenState = PacManGhostFrozenState.Frozen; + + Index = index; } public void Reset() @@ -758,8 +763,6 @@ namespace Marro.PacManUdon return ghostState; } - public bool IsScared => isScared; - public void SetSpeed(float speed) { this.speed = speed; @@ -780,15 +783,15 @@ namespace Marro.PacManUdon data.Append(turnAroundSoon, ref index); data.Append(speed, ref index); - data.Append((byte)ghostState, ref index); + data.AppendAsByte((int)ghostState, ref index); data.Append(isScared, ref index); data.Append(scattering, ref index); - data.Append((byte)frozenState, ref index); + data.AppendAsByte((int)frozenState, ref index); data.Append(offGrid, ref index); - data.Append((byte)housePelletCounter, ref index); + data.AppendAsByte(housePelletCounter, ref index); data.Append(housePelletCounterActive, ref index); - data.Append((byte)housePelletCounterLimit, ref index); + data.AppendAsByte(housePelletCounterLimit, ref index); data.Append(faceInStartingDirectionUntilUnfrozen, ref index); base.CollectSyncedData(data, ref index, eventType); @@ -806,6 +809,7 @@ namespace Marro.PacManUdon inTunnel = data.ReadBool(ref index); rngState = data.ReadInt(ref index); turnAroundSoon = data.ReadBool(ref index); + Debug.Log($"{gameObject} turnAroundSoon = {turnAroundSoon}"); speed = data.ReadFloat(ref index); ghostState = (PacManGhostState)data.ReadByte(ref index); diff --git a/Assets/Scripts/GhostManager.asset b/Assets/Scripts/GhostManager.asset index 07dae0b..fbace77 100644 --- a/Assets/Scripts/GhostManager.asset +++ b/Assets/Scripts/GhostManager.asset @@ -781,25 +781,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: powerPelletActive + Data: powerPelletDuration - Name: $v Entry: 7 Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: powerPelletActive + Data: powerPelletDuration - Name: k__BackingField - Entry: 7 - Data: 41|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Boolean, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 21 - Name: k__BackingField Entry: 9 - Data: 41 + Data: 21 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -814,7 +808,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -835,19 +829,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: powerPelletDuration + Data: scatterPattern - Name: $v Entry: 7 - Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: powerPelletDuration + Data: scatterPattern - Name: k__BackingField - Entry: 9 - Data: 21 + Entry: 7 + Data: 43|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single[], mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 21 + Data: 43 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -883,13 +883,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: powerPelletCountdown + Data: pelletTimeoutLimit - Name: $v Entry: 7 Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: powerPelletCountdown + Data: pelletTimeoutLimit - Name: k__BackingField Entry: 9 Data: 21 @@ -931,19 +931,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: powerPelletMultiplier + Data: powerPelletActive - Name: $v Entry: 7 Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: powerPelletMultiplier + Data: powerPelletActive - Name: k__BackingField - Entry: 9 - Data: 36 + Entry: 7 + Data: 48|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 36 + Data: 48 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -958,7 +964,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 48|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 @@ -979,25 +985,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: ghostScaredQueue + Data: powerPelletCountdown - Name: $v Entry: 7 - Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: ghostScaredQueue + Data: powerPelletCountdown - Name: k__BackingField - Entry: 7 - Data: 50|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: VRC.SDK3.Data.DataList, VRCSDK3 - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 21 - Name: k__BackingField Entry: 9 - Data: 50 + Data: 21 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1033,19 +1033,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: blinkingActivated + Data: powerPelletMultiplier - Name: $v Entry: 7 Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: blinkingActivated + Data: powerPelletMultiplier - Name: k__BackingField Entry: 9 - Data: 41 + Data: 36 - Name: k__BackingField Entry: 9 - Data: 41 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1081,10 +1081,112 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: blinkCountdown + Data: ghostScaredQueue - Name: $v Entry: 7 Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ghostScaredQueue + - Name: k__BackingField + Entry: 7 + Data: 55|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.SDK3.Data.DataList, VRCSDK3 + - 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: blinkingActivated + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: blinkingActivated + - Name: k__BackingField + Entry: 9 + Data: 48 + - Name: k__BackingField + Entry: 9 + Data: 48 + - 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: 58|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: blinkCountdown + - Name: $v + Entry: 7 + Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: blinkCountdown @@ -1108,7 +1210,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1132,118 +1234,16 @@ MonoBehaviour: Data: blinkCurrentlyWhite - Name: $v Entry: 7 - Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: blinkCurrentlyWhite - Name: k__BackingField Entry: 9 - Data: 41 + Data: 48 - Name: k__BackingField Entry: 9 - Data: 41 - - 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: 57|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: scatterCounter - - Name: $v - Entry: 7 - Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: scatterCounter - - Name: k__BackingField - Entry: 9 - Data: 21 - - 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: false - - Name: _fieldAttributes - Entry: 7 - Data: 59|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: scatterPattern - - Name: $v - Entry: 7 - Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: scatterPattern - - Name: k__BackingField - Entry: 7 - Data: 61|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Single[], mscorlib - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 61 + Data: 48 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1279,19 +1279,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: scatterPatternIndex + Data: scatterCounter - Name: $v Entry: 7 Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: scatterPatternIndex + Data: scatterCounter - Name: k__BackingField Entry: 9 - Data: 36 + Data: 21 - Name: k__BackingField Entry: 9 - Data: 36 + Data: 21 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1327,13 +1327,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: elroyLevel + Data: scatterPatternIndex - Name: $v Entry: 7 Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: elroyLevel + Data: scatterPatternIndex - Name: k__BackingField Entry: 9 Data: 36 @@ -1351,7 +1351,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 5 - Data: true + Data: false - Name: _fieldAttributes Entry: 7 Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib @@ -1375,19 +1375,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: sharedPelletCounterActive + Data: elroyLevel - Name: $v Entry: 7 Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: sharedPelletCounterActive + Data: elroyLevel - Name: k__BackingField Entry: 9 - Data: 41 + Data: 36 - Name: k__BackingField Entry: 9 - Data: 41 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1399,7 +1399,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 5 - Data: false + Data: true - Name: _fieldAttributes Entry: 7 Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib @@ -1423,19 +1423,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: sharedPelletCounter + Data: sharedPelletCounterActive - Name: $v Entry: 7 Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: sharedPelletCounter + Data: sharedPelletCounterActive - Name: k__BackingField Entry: 9 - Data: 36 + Data: 48 - Name: k__BackingField Entry: 9 - Data: 36 + Data: 48 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1471,25 +1471,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: sharedPelletCounterReleaseValues + Data: sharedPelletCounter - Name: $v Entry: 7 Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: sharedPelletCounterReleaseValues + Data: sharedPelletCounter - Name: k__BackingField - Entry: 7 - Data: 72|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32[], mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 36 - Name: k__BackingField Entry: 9 - Data: 72 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1504,7 +1498,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 73|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 @@ -1525,19 +1519,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: pelletTimeout + Data: sharedPelletCounterReleaseValues - Name: $v Entry: 7 - Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: pelletTimeout + Data: sharedPelletCounterReleaseValues - Name: k__BackingField - Entry: 9 - Data: 21 + Entry: 7 + Data: 74|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32[], mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 21 + Data: 74 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1573,13 +1573,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: pelletTimeoutLimit + Data: pelletTimeout - Name: $v Entry: 7 Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: pelletTimeoutLimit + Data: pelletTimeout - Name: k__BackingField Entry: 9 Data: 21 @@ -1630,10 +1630,10 @@ MonoBehaviour: Data: frozen - Name: k__BackingField Entry: 9 - Data: 41 + Data: 48 - Name: k__BackingField Entry: 9 - Data: 41 + Data: 48 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1678,10 +1678,10 @@ MonoBehaviour: Data: kinematic - Name: k__BackingField Entry: 9 - Data: 41 + Data: 48 - Name: k__BackingField Entry: 9 - Data: 41 + Data: 48 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib diff --git a/Assets/Scripts/GhostManager.cs b/Assets/Scripts/GhostManager.cs index 187e20f..61f5b97 100644 --- a/Assets/Scripts/GhostManager.cs +++ b/Assets/Scripts/GhostManager.cs @@ -24,9 +24,12 @@ namespace Marro.PacManUdon private int elroy1PelletCount; private int elroy2PelletCount; + private float powerPelletDuration; + private float[] scatterPattern; + private float pelletTimeoutLimit; + // Power Pellet logic private bool powerPelletActive; - private float powerPelletDuration; private float powerPelletCountdown; private int powerPelletMultiplier; @@ -40,7 +43,6 @@ namespace Marro.PacManUdon // Scattering logic private float scatterCounter; - private float[] scatterPattern; private int scatterPatternIndex; // Elroy logic @@ -51,12 +53,10 @@ namespace Marro.PacManUdon private int sharedPelletCounter; private readonly int[] sharedPelletCounterReleaseValues = { 0, 7, 17, 32 }; private float pelletTimeout; - private float pelletTimeoutLimit; private bool frozen; private bool kinematic; - // This should be called once when the game is initialized public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, PelletManager pelletManager, GameManager gameController) { this.gameController = gameController; @@ -72,12 +72,11 @@ namespace Marro.PacManUdon Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition; Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition; - ghosts[ghostIndex].Initialize(pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition); + ghosts[ghostIndex].Initialize(pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex); } } - // This should be called every time the level is reset - public void Reset(bool afterLifeLost = false) + public void RestartLevel(bool afterLifeLost = false) { ghostScaredQueue = new DataList(); powerPelletActive = false; @@ -192,7 +191,9 @@ namespace Marro.PacManUdon gameController.GhostCaught(0); return; } + // Debug.Log($"{gameObject} GhostCaughtQueue with ghost {ghost}"); + networkManager.SendEventSoon(NetworkEventType.GhostUpdate); ghostScaredQueue.Add(ghost); GhostCaughtExecute(ghost); } @@ -314,6 +315,18 @@ namespace Marro.PacManUdon public void SetLevel(int level) { Debug.Log($"GhostManager: SetLevel {level}"); + SetLevelConstants(level); + + int[] privatePelletCounterReleaseValues = PacManConstants.GetGhostHousePrivatePelletCounterLimitForLevel(level); + for (int i = 0; i < ghosts.Length; i++) + { + ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]); + RestartLevel(); // Reset needed to properly apply level + } + } + + private void SetLevelConstants(int level) + { speedDefault = PacManConstants.GetGhostDefaultSpeedForLevel(level); speedScared = PacManConstants.GetGhostScaredSpeedForLevel(level); speedReturn = 15f; @@ -326,13 +339,6 @@ namespace Marro.PacManUdon powerPelletDuration = PacManConstants.GetScaredDurationForLevel(level); scatterPattern = PacManConstants.GetScatterPatternForLevel(level); pelletTimeoutLimit = PacManConstants.GetGhostHousePelletTimeoutLimitForLevel(level); - - int[] privatePelletCounterReleaseValues = PacManConstants.GetGhostHousePrivatePelletCounterLimitForLevel(level); - for (int i = 0; i < ghosts.Length; i++) - { - ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]); - Reset(); // Reset needed to properly apply level - } } public float GetTargetSpeed(Ghost ghost, PacManGhostState ghostState, bool isScared, bool inTunnel) @@ -478,11 +484,100 @@ namespace Marro.PacManUdon public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) { - + if (eventType != NetworkEventType.GhostUpdate) + { + return; + } + + // Power Pellet logic + data.Append(powerPelletActive, ref index); + data.Append(powerPelletCountdown, ref index); + data.AppendAsByte(powerPelletMultiplier, ref index); + + // Blink logic + data.Append(blinkingActivated, ref index); + data.Append(blinkCountdown, ref index); + data.Append(blinkCurrentlyWhite, ref index); + + // Scattering logic + data.Append(scatterCounter, ref index); + data.AppendAsByte(scatterPatternIndex, ref index); + + // Elroy logic + data.AppendAsByte(elroyLevel, ref index); + + // Ghost house logic + data.Append(sharedPelletCounterActive, ref index); + data.AppendAsByte(sharedPelletCounter, ref index); + data.Append(pelletTimeout, ref index); + + data.Append(frozen, ref index); + data.Append(kinematic, ref index); + + data.AppendAsByte(gameController.Level, ref index); + + var ghostScaredQueueArray = new byte[ghosts.Length]; + for (int i = 0; i < ghostScaredQueueArray.Length; i++) + { + var add = ghostScaredQueue.TryGetValue(i, out var ghost); + if (!add) + { + ghostScaredQueueArray[i] = byte.MaxValue; // Add a terminator + break; + } + ghostScaredQueueArray[i] = (byte)((Ghost)ghost.Reference).Index; + } + Debug.Log($"{gameObject} Sent a ghostScareQueue of length {ghostScaredQueue.Count}"); + data.Append(ghostScaredQueueArray, ref index); } public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) { + if (eventType != NetworkEventType.GhostUpdate) + { + return true; + } + + // Power Pellet logic + powerPelletActive = data.ReadBool(ref index); + powerPelletCountdown = data.ReadFloat(ref index); + powerPelletMultiplier = data.ReadByte(ref index); + + // Blink logic + blinkingActivated = data.ReadBool(ref index); + blinkCountdown = data.ReadFloat(ref index); + blinkCurrentlyWhite = data.ReadBool(ref index); + + // Scattering logic + scatterCounter = data.ReadFloat(ref index); + scatterPatternIndex = data.ReadByte(ref index); + + // Elroy logic + elroyLevel = data.ReadByte(ref index); + + // Ghost house logic + sharedPelletCounterActive = data.ReadBool(ref index); + sharedPelletCounter = data.ReadByte(ref index); + pelletTimeout = data.ReadFloat(ref index); + + frozen = data.ReadBool(ref index); + kinematic = data.ReadBool(ref index); + + var level = data.ReadByte(ref index); + SetLevelConstants(level); + + ghostScaredQueue.Clear(); + for (int i = 0; i < ghosts.Length; i++) + { + var ghostIndex = data[index + i]; + if (ghostIndex > ghosts.Length) // Reached terminator + { + break; + } + ghostScaredQueue.Add(ghosts[ghostIndex]); + } + Debug.Log($"{gameObject} Read back a ghostScareQueue of length {ghostScaredQueue.Count}"); + return true; } diff --git a/Assets/Scripts/GridMover.cs b/Assets/Scripts/GridMover.cs index 08402fb..8d03faf 100644 --- a/Assets/Scripts/GridMover.cs +++ b/Assets/Scripts/GridMover.cs @@ -32,22 +32,12 @@ namespace Marro.PacManUdon public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) { - if (eventType != NetworkEventType.PacManTurn) - { - return; - } - data.Append(GetPosition(), ref index); data.Append(GetDirection(), ref index); } public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) { - if (eventType != NetworkEventType.PacManTurn) - { - return true; - } - SetPosition(data.ReadVector2(ref index)); SetDirection(data.ReadVector2(ref index)); diff --git a/Assets/Scripts/NetworkManager.cs b/Assets/Scripts/NetworkManager.cs index f353480..730229c 100644 --- a/Assets/Scripts/NetworkManager.cs +++ b/Assets/Scripts/NetworkManager.cs @@ -439,7 +439,7 @@ namespace Marro.PacManUdon var timestampBytes = BitConverter.GetBytes(timestamp); Array.Copy(timestampBytes, 0, data, HeaderTimestampIndex, timestampBytes.Length); data[HeaderEventIdIndex] = eventId; - data[HeaderEventTypeIndex] = Int32ToByte((int)eventType); + data[HeaderEventTypeIndex] = ((int)eventType).ToByte(); index = HeaderLength; } @@ -926,9 +926,6 @@ namespace Marro.PacManUdon Array.Copy(data, start, result, 0, length); return result; } - - public static byte Int32ToByte(int value) => - (byte)value; // Doing this inline causes an error...? #endregion #region Debug @@ -969,6 +966,11 @@ namespace Marro.PacManUdon { SendEventSoon(NetworkEventType.SyncPellets); } + + public void DoGhostSync() + { + SendEventSoon(NetworkEventType.GhostUpdate); + } #endregion } } diff --git a/Assets/Scripts/Sequences/AttractScreenIntroduction.cs b/Assets/Scripts/Sequences/AttractScreenIntroduction.cs index d19fc62..93d9bdb 100644 --- a/Assets/Scripts/Sequences/AttractScreenIntroduction.cs +++ b/Assets/Scripts/Sequences/AttractScreenIntroduction.cs @@ -92,7 +92,7 @@ namespace Marro.PacManUdon pacMan.SetPosition(attractScreenElements[16].transform.localPosition); pacMan.SetDirection(Vector2.left); - ghostManager.Reset(); + ghostManager.RestartLevel(); ghostManager.SetLevel(2); ghostManager.SetKinematic(true); ghostManager.SetActive(true);