diff --git a/Assets/Maze/maze collision.bmp b/Assets/Maze/maze collision.bmp new file mode 100644 index 0000000..dcd2fdb Binary files /dev/null and b/Assets/Maze/maze collision.bmp differ diff --git a/Assets/Maze/maze collision.bmp.meta b/Assets/Maze/maze collision.bmp.meta new file mode 100644 index 0000000..0a14833 --- /dev/null +++ b/Assets/Maze/maze collision.bmp.meta @@ -0,0 +1,114 @@ +fileFormatVersion: 2 +guid: 433bc126202e0994fa11758168105efa +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/PacMan.unity b/Assets/Scenes/PacMan.unity index 4e2a5c0..026692a 100644 --- a/Assets/Scenes/PacMan.unity +++ b/Assets/Scenes/PacMan.unity @@ -3955,7 +3955,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &805005471 Transform: m_ObjectHideFlags: 0 @@ -6266,6 +6266,10 @@ PrefabInstance: propertyPath: serializationData.Prefab value: objectReference: {fileID: 626384261962381809, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + - target: {fileID: 642653665749402579, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2541243872366204002, guid: 7168d13094fcae94b81e672d1f4ab73f, type: 2} - target: {fileID: 690094551578429092, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} propertyPath: serializationData.Prefab value: @@ -10831,10 +10835,6 @@ MonoBehaviour: ID: 308 SerializedTypeNames: - VRC.Udon.UdonBehaviour - - gameObject: {fileID: 1777057122} - ID: 39 - SerializedTypeNames: - - VRC.Udon.UdonBehaviour - gameObject: {fileID: 2121595711} ID: 310 SerializedTypeNames: @@ -11980,6 +11980,11 @@ MonoBehaviour: SerializedTypeNames: - VRC.Udon.UdonBehaviour - VRC.Udon.UdonBehaviour + - gameObject: {fileID: 1777057122} + ID: 39 + SerializedTypeNames: + - VRC.Udon.UdonBehaviour + - VRC.Udon.UdonBehaviour portraitCameraPositionOffset: {x: 0, y: 0, z: 0} portraitCameraRotationOffset: {x: 0, y: 1, z: 0, w: -0.00000004371139} PlayerPersistence: [] @@ -12129,6 +12134,53 @@ GameObject: m_CorrespondingSourceObject: {fileID: 8569251470677094682, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 7528894854307259292} m_PrefabAsset: {fileID: 0} +--- !u!114 &1777057126 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1777057122} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 2 + serializedProgramAsset: {fileID: 11400000, guid: ea99e044f80fed446bb669640608f521, type: 2} + programSource: {fileID: 11400000, guid: 909752e684c57f24093795e3ba5e2c80, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 +--- !u!114 &1777057127 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1777057122} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30a9bec71a4b36a41a9b6ee899bef38c, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 1777057126} --- !u!1 &1785134014 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7466015648019123541, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -14886,6 +14938,10 @@ PrefabInstance: propertyPath: serializationData.Prefab value: objectReference: {fileID: 6074801139074197290, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + - target: {fileID: 6124172593973027271, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} - target: {fileID: 6155378856640629001, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} propertyPath: serializationData.Prefab value: @@ -15312,6 +15368,12 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 7219308242589081280, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} insertIndex: -1 addedObject: {fileID: 0} + - targetCorrespondingSourceObject: {fileID: 8569251470677094682, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + insertIndex: -1 + addedObject: {fileID: 1777057127} + - targetCorrespondingSourceObject: {fileID: 8569251470677094682, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + insertIndex: -1 + addedObject: {fileID: 1777057126} - targetCorrespondingSourceObject: {fileID: 5818876718058315162, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} insertIndex: -1 addedObject: {fileID: 0} diff --git a/Assets/Scripts/GameManager.asset b/Assets/Scripts/GameManager.asset index 1cd6e55..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,19 +1772,25 @@ 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 @@ -1763,7 +1805,7 @@ 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 @@ -1785,19 +1827,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: level + Data: timeSequenceProgress - Name: $v Entry: 7 - Data: 104|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 @@ -1812,7 +1854,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 105|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], + Data: 106|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 @@ -1834,68 +1876,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: highScore + Data: timeSequenceKeyframeTimes - Name: $v Entry: 7 - Data: 106|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 - - 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: 107|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: 108|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 + Data: 108 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index e3a8855..5ccd1af 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -59,7 +59,7 @@ namespace Marro.PacManUdon networkManager.Initialize(); ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, pelletManager, this); - pacMan.Initialize(playerInput, maze.pacManStart, this); + pacMan.Initialize(playerInput, maze.pacManStart, this, pelletManager); bonusFruit.Initialize(); pelletManager.Initialize(); statusDisplay.Initialize(); diff --git a/Assets/Scripts/Ghost.asset b/Assets/Scripts/Ghost.asset index a9d6d3a..90b2d41 100644 --- a/Assets/Scripts/Ghost.asset +++ b/Assets/Scripts/Ghost.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 37 + Data: 40 - Name: Entry: 7 Data: @@ -121,67 +121,13 @@ MonoBehaviour: Data: 7|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Vector2, UnityEngine.CoreModule - - 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: ghostType - - Name: $v - Entry: 7 - Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: ghostType - - Name: k__BackingField - Entry: 7 - Data: 10|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.PacManGhostType, Assembly-CSharp + Data: Marro.PacManUdon.Direction, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField Entry: 7 - Data: 11|System.RuntimeType, mscorlib + Data: 8|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Int32, mscorlib @@ -197,132 +143,12 @@ MonoBehaviour: - Name: Entry: 8 Data: - - Name: k__BackingField - Entry: 5 - Data: true - - Name: _fieldAttributes - Entry: 7 - Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 13|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: startState - - Name: $v - Entry: 7 - Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: startState - - Name: k__BackingField - Entry: 7 - Data: 15|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.PacManGhostStartState, Assembly-CSharp - - Name: - Entry: 8 - Data: - - 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: true - - Name: _fieldAttributes - Entry: 7 - Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 17|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: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: ghostManager - - Name: k__BackingField - Entry: 7 - Data: 19|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: false - Name: _fieldAttributes Entry: 7 - Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -343,25 +169,199 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: animator + Data: directionVectors - Name: $v Entry: 7 - Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: animator + Data: directionVectors - Name: k__BackingField Entry: 7 - Data: 22|System.RuntimeType, mscorlib + Data: 11|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Animator, UnityEngine.AnimationModule + Data: UnityEngine.Vector2[], UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 22 + 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: 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: ghostType + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ghostType + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.PacManGhostType, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - 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: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 16|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: startState + - Name: $v + Entry: 7 + Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: startState + - Name: k__BackingField + Entry: 7 + Data: 18|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.PacManGhostStartState, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - 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: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 20|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: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ghostManager + - Name: k__BackingField + Entry: 7 + Data: 22|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 @@ -397,25 +397,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: renderer + Data: pelletManager - Name: $v Entry: 7 Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: renderer + Data: pelletManager - Name: k__BackingField Entry: 7 Data: 25|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Renderer, UnityEngine.CoreModule + Data: Marro.PacManUdon.PelletManager, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 25 + Data: 4 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -451,25 +451,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: pacMan + Data: animator - Name: $v Entry: 7 Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: pacMan + Data: animator - Name: k__BackingField Entry: 7 Data: 28|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.PacMan, Assembly-CSharp + Data: UnityEngine.Animator, UnityEngine.AnimationModule - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 4 + Data: 28 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -505,25 +505,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: blinky + Data: renderer - Name: $v Entry: 7 Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: blinky + Data: renderer - Name: k__BackingField Entry: 7 Data: 31|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.Ghost, Assembly-CSharp + Data: UnityEngine.Renderer, UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 4 + Data: 31 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -559,19 +559,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: scoreBonusDisplay + Data: pacMan - Name: $v Entry: 7 Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: scoreBonusDisplay + Data: pacMan - Name: k__BackingField Entry: 7 Data: 34|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.ScoreBonusDisplay, Assembly-CSharp + Data: Marro.PacManUdon.PacMan, Assembly-CSharp - Name: Entry: 8 Data: @@ -613,25 +613,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: startPosition + Data: blinky - Name: $v Entry: 7 Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: startPosition + Data: blinky - Name: k__BackingField Entry: 7 Data: 37|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Vector3, UnityEngine.CoreModule + Data: Marro.PacManUdon.Ghost, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 37 + Data: 4 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -667,25 +667,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: startRotation + Data: scoreBonusDisplay - Name: $v Entry: 7 Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: startRotation + Data: scoreBonusDisplay - Name: k__BackingField Entry: 7 Data: 40|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Quaternion, UnityEngine.CoreModule + Data: Marro.PacManUdon.ScoreBonusDisplay, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 40 + Data: 4 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -721,19 +721,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: homePosition + Data: startPosition - Name: $v Entry: 7 Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: homePosition + Data: startPosition - Name: k__BackingField - Entry: 9 - Data: 7 + Entry: 7 + Data: 43|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector3, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 7 + Data: 43 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -748,7 +754,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 43|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -769,67 +775,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: idlePosition1 + Data: startRotation - Name: $v Entry: 7 - Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: idlePosition1 + Data: startRotation - Name: k__BackingField - Entry: 9 - Data: 7 + Entry: 7 + Data: 46|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Quaternion, UnityEngine.CoreModule + - 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: 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: idlePosition2 - - Name: $v - Entry: 7 - Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: idlePosition2 - - Name: k__BackingField - Entry: 9 - Data: 7 - - Name: k__BackingField - Entry: 9 - Data: 7 + Data: 46 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -865,19 +829,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: cornerPosition + Data: homePosition - Name: $v Entry: 7 Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: cornerPosition + Data: homePosition - Name: k__BackingField - Entry: 9 - Data: 7 + Entry: 7 + Data: 49|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector2, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 7 + Data: 49 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -892,7 +862,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -913,19 +883,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: target + Data: idlePosition1 - Name: $v Entry: 7 - Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: target + Data: idlePosition1 - Name: k__BackingField Entry: 9 - Data: 7 + Data: 49 - Name: k__BackingField Entry: 9 - Data: 7 + Data: 49 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -940,7 +910,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 +931,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: horizontalOnly + Data: idlePosition2 - Name: $v Entry: 7 - Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: horizontalOnly + Data: idlePosition2 - Name: k__BackingField - Entry: 7 - Data: 53|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Boolean, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 49 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 49 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1015,19 +979,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: inTunnel + Data: cornerPosition - Name: $v Entry: 7 Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: inTunnel + Data: cornerPosition - Name: k__BackingField Entry: 9 - Data: 53 + Data: 49 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 49 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1063,19 +1027,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: rngState + Data: target - Name: $v Entry: 7 Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: rngState + Data: target - Name: k__BackingField Entry: 9 - Data: 11 + Data: 49 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 49 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1111,19 +1075,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: turnAroundSoon + Data: horizontalOnly - Name: $v Entry: 7 Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: turnAroundSoon + Data: horizontalOnly - Name: k__BackingField - Entry: 9 - Data: 53 + Entry: 7 + Data: 60|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1138,7 +1108,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1159,25 +1129,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: speed + Data: inTunnel - Name: $v Entry: 7 - Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: speed + Data: inTunnel - Name: k__BackingField - Entry: 7 - Data: 62|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Single, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 62 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1213,25 +1177,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: ghostState + Data: rngState - Name: $v Entry: 7 Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: ghostState + Data: rngState - Name: k__BackingField - Entry: 7 - Data: 65|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.PacManGhostState, Assembly-CSharp - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 8 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 8 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1246,7 +1204,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 66|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 @@ -1267,19 +1225,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: isScared + Data: turnAroundSoon - Name: $v Entry: 7 - Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: isScared + Data: turnAroundSoon - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1294,7 +1252,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1315,19 +1273,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: scattering + Data: speed - Name: $v Entry: 7 - Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: scattering + Data: speed - Name: k__BackingField - Entry: 9 - Data: 53 + Entry: 7 + Data: 69|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 53 + Data: 69 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1363,25 +1327,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: frozenState + Data: ghostState - Name: $v Entry: 7 Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: frozenState + Data: ghostState - Name: k__BackingField Entry: 7 Data: 72|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: Marro.PacManUdon.PacManGhostFrozenState, Assembly-CSharp + Data: Marro.PacManUdon.PacManGhostState, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 11 + Data: 8 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1417,19 +1381,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: offGrid + Data: isScared - Name: $v Entry: 7 Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: offGrid + Data: isScared - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1465,19 +1429,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: housePelletCounter + Data: scattering - Name: $v Entry: 7 Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: housePelletCounter + Data: scattering - Name: k__BackingField Entry: 9 - Data: 11 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1513,19 +1477,169 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: housePelletCounterActive + Data: frozenState - Name: $v Entry: 7 Data: 78|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: frozenState + - Name: k__BackingField + Entry: 7 + Data: 79|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.PacManGhostFrozenState, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - 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: offGrid + - Name: $v + Entry: 7 + Data: 81|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: offGrid + - Name: k__BackingField + Entry: 9 + Data: 60 + - Name: k__BackingField + Entry: 9 + Data: 60 + - 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: 82|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: housePelletCounter + - Name: $v + Entry: 7 + Data: 83|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: housePelletCounter + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 9 + Data: 8 + - 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: 84|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: housePelletCounterActive + - Name: $v + Entry: 7 + Data: 85|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: housePelletCounterActive - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1540,7 +1654,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 79|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 86|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1564,16 +1678,16 @@ MonoBehaviour: Data: housePelletCounterLimit - Name: $v Entry: 7 - Data: 80|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 87|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: housePelletCounterLimit - Name: k__BackingField Entry: 9 - Data: 11 + Data: 8 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 8 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1588,7 +1702,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 81|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 @@ -1612,16 +1726,16 @@ MonoBehaviour: Data: faceInStartingDirectionUntilUnfrozen - Name: $v Entry: 7 - Data: 82|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: faceInStartingDirectionUntilUnfrozen - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1636,7 +1750,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 83|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 90|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1660,166 +1774,16 @@ MonoBehaviour: Data: kinematic - Name: $v Entry: 7 - Data: 84|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 91|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: kinematic - Name: k__BackingField Entry: 9 - Data: 53 + Data: 60 - 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: 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: specialLook - - Name: $v - Entry: 7 - Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: specialLook - - 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: 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: followingPredefinedPath - - Name: $v - Entry: 7 - Data: 88|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: followingPredefinedPath - - 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: 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: predefinedPath - - Name: $v - Entry: 7 - Data: 90|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: predefinedPath - - Name: k__BackingField - Entry: 7 - Data: 91|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Vector2[], UnityEngine.CoreModule - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 91 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1855,19 +1819,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: predefinedPathIndex + Data: specialLook - Name: $v Entry: 7 Data: 93|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: predefinedPathIndex + Data: specialLook - Name: k__BackingField Entry: 9 - Data: 11 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1903,19 +1867,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: k__BackingField + Data: followingPredefinedPath - Name: $v Entry: 7 Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: k__BackingField + Data: followingPredefinedPath - Name: k__BackingField Entry: 9 - Data: 11 + Data: 60 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 60 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1946,6 +1910,213 @@ MonoBehaviour: - Name: Entry: 8 Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: predefinedPath + - Name: $v + Entry: 7 + Data: 97|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: predefinedPath + - 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: 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: 7 + Data: + - Name: $k + Entry: 1 + Data: predefinedPathIndex + - Name: $v + Entry: 7 + Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: predefinedPathIndex + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 9 + Data: 8 + - 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: 100|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: k__BackingField + - Name: $v + Entry: 7 + Data: 101|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: k__BackingField + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 9 + Data: 8 + - 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: 102|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: cardinalDirections + - Name: $v + Entry: 7 + Data: 103|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: cardinalDirections + - Name: k__BackingField + Entry: 7 + Data: 104|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.Direction[], Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 105|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: 106|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 85b2df2..e117e11 100644 --- a/Assets/Scripts/Ghost.cs +++ b/Assets/Scripts/Ghost.cs @@ -41,6 +41,7 @@ namespace Marro.PacManUdon // External references private GhostManager ghostManager; + private PelletManager pelletManager; private Animator animator; private new Renderer renderer; private PacMan pacMan; @@ -88,12 +89,13 @@ namespace Marro.PacManUdon 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) + public void Initialize(PelletManager pelletManager, PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition, int index) { ghostManager = transform.parent.GetComponent(); animator = GetComponent(); renderer = GetComponent(); + this.pelletManager = pelletManager; this.pacMan = pacMan; this.blinky = blinky; this.homePosition = homePosition; @@ -158,7 +160,7 @@ namespace Marro.PacManUdon } Vector2 position = GetPosition(); - Vector2 nextPosition = GridMoverTools.GetNextPosition(position, direction, speed, networkManager.SyncedDeltaTime); + Vector2 nextPosition = GetNextPosition(position, directionVectors[(int)direction], speed, networkManager.SyncedDeltaTime); nextPosition = ProcessNextPosition(position, nextPosition); @@ -168,10 +170,11 @@ namespace Marro.PacManUdon private Vector2 ProcessNextPosition(Vector2 position, Vector2 nextPosition) { if (turnAroundSoon && ghostState == PacManGhostState.Normal - && GridMoverTools.CrossesTileBorder(position, nextPosition, direction.x != 0, direction.y != 0)) + && CrossesTileBorder(position, nextPosition, direction)) { - SetDirection(direction * -1); - //Debug.Log($"{gameObject} turned around to direction {GetDirection()}"); + var newDirection = GetInverseDirection(direction); + Debug.Log($"{gameObject} turned around from direction {direction} to {newDirection}"); + SetDirection(newDirection); turnAroundSoon = false; return nextPosition; } @@ -216,21 +219,19 @@ namespace Marro.PacManUdon { nextPosition = ProcessPredefinedPath(position, nextPosition); } - else if (!offGrid && GridMoverTools.CrossesTileCenter(position, nextPosition, direction.x != 0, direction.y != 0)) + else if (!offGrid && CrossesTileCenter(position, nextPosition, direction)) { - Vector2 gridPosition = GridMoverTools.PositionToGrid(position); - Vector2[] availableDirections = GetAvailableDirections(gridPosition, direction * -1); - if (availableDirections.Length > 1) + var gridPosition = PositionToGrid(position); + var blockedDirections = pelletManager.GetBlockedDirections(position); + blockedDirections[GetIllegalCardinalDirection(direction)] = true; // Not allowed to turn around + + target = GetGridTarget(gridPosition); + var newDirection = GetGridDirectionToTargetGreedy(blockedDirections, gridPosition, target); + if (newDirection != direction) { - target = GetGridTarget(gridPosition); - SetDirection(GetGridDirectionToTargetGreedy(availableDirections, gridPosition, target)); - nextPosition = GridMoverTools.GetNextPosition(gridPosition, direction, speed, networkManager.SyncedDeltaTime); - // Debug.Log($"GetNextPosition at gridPosition {gridPosition} with direction {direction} and speed {speed} gives nextPosition {nextPosition}"); - } - else if (availableDirections.Length == 1 && availableDirections[0] != direction) - { - SetDirection(availableDirections[0]); - nextPosition = GridMoverTools.GetNextPosition(gridPosition, direction, speed, networkManager.SyncedDeltaTime); + Debug.Log($"{gameObject.name} Was moving in direction {direction}, continues with moving in direction {newDirection}"); + nextPosition = GetNextPosition(gridPosition, directionVectors[(int)newDirection], speed, networkManager.SyncedDeltaTime); + SetDirection(newDirection); } // Debug.Log($"{gameObject} crossed tile center {gridPosition}, new target: {target}, new direction: {direction}"); } @@ -244,9 +245,26 @@ namespace Marro.PacManUdon return nextPosition; } + private int GetIllegalCardinalDirection(Direction direction) + { + switch (direction) + { + case Direction.Up: + return 1; + case Direction.Down: + return 0; + case Direction.Left: + return 3; + case Direction.Right: + return 2; + default: + return 0; + } + } + private Vector2 ProcessPredefinedPath(Vector2 position, Vector2 nextPosition) { - if (GridMoverTools.CrossesTileCenter(position, nextPosition, direction.x != 0, direction.y != 0)) + if (CrossesTileCenter(position, nextPosition, direction)) { // Find the next valid direction which isn't Vector2.zero int nextValidDirectionIndex = predefinedPathIndex; @@ -254,13 +272,13 @@ namespace Marro.PacManUdon { nextValidDirectionIndex += 1; } - if (!GridMoverTools.CheckCollisionInDirection(transform, nextPosition, predefinedPath[nextValidDirectionIndex])) + if (!CheckCollisionInDirection(transform, nextPosition, predefinedPath[nextValidDirectionIndex])) { // If we're at a Vector2.zero, we skip applying the direction and only increment. if (nextValidDirectionIndex == predefinedPathIndex) { SetDirection(predefinedPath[nextValidDirectionIndex]); - nextPosition = GridMoverTools.PositionToGrid(nextPosition) + direction.normalized * 0.01f; + nextPosition = PositionToGrid(nextPosition) + GetVector(direction) * 0.01f; // Check if we've reached the end of the path, which includes making sure the path doesn't end on Vector2.zero do @@ -323,15 +341,15 @@ namespace Marro.PacManUdon default: return gridPosition; case PacManGhostType.Blinky: - return GridMoverTools.PositionToGrid(pacMan.transform.localPosition); + return PositionToGrid(pacMan.transform.localPosition); case PacManGhostType.Pinky: - return GridMoverTools.PositionToGrid(pacMan.transform.localPosition) + pacMan.GetDirection() * 4; + return PositionToGrid(pacMan.transform.localPosition) + pacMan.GetVector(direction) * 4; case PacManGhostType.Inky: - return 2 * GridMoverTools.PositionToGrid(pacMan.transform.localPosition) + 4 * pacMan.GetDirection() - GridMoverTools.PositionToGrid(blinky.transform.localPosition); + return 2 * PositionToGrid(pacMan.transform.localPosition) + 4 * pacMan.GetVector(direction) - PositionToGrid(blinky.transform.localPosition); case PacManGhostType.Clyde: - if (Vector2.Distance(gridPosition, GridMoverTools.PositionToGrid(pacMan.transform.localPosition)) >= 8) + if (Vector2.Distance(gridPosition, PositionToGrid(pacMan.transform.localPosition)) >= 8) { - return GridMoverTools.PositionToGrid(pacMan.transform.localPosition); + return PositionToGrid(pacMan.transform.localPosition); } else { @@ -386,7 +404,7 @@ namespace Marro.PacManUdon case PacManGhostState.Exiting: offGrid = false; SetState(PacManGhostState.Normal); - SetDirection(Vector2.left); + SetDirection(Direction.Left); break; } } @@ -395,11 +413,11 @@ namespace Marro.PacManUdon { if (startHorizontal) { - SetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Vector2.right)); + SetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Direction.Right)); } else { - SetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Vector2.down)); + SetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Direction.Down)); } // Debug.Log($"{gameObject} SetOffGridTarget with position {GetPosition()}, newTarget {newTarget}, startHorizontal {startHorizontal} resulted in direction {direction}"); target = newTarget; @@ -413,69 +431,42 @@ namespace Marro.PacManUdon return rngState; } - Vector2[] GetAvailableDirections(Vector2 gridPosition, Vector2 discardDirection) + private Direction[] cardinalDirections = new Direction[] { Direction.Up, Direction.Down, Direction.Left, Direction.Right }; + Direction GetGridDirectionToTargetGreedy(bool[] blockedDirections, Vector2 gridPosition, Vector2 targetGridPosition) { - Vector2[] directions; - Vector2[] availableDirections; - if (horizontalOnly && ghostState == PacManGhostState.Normal) + Direction bestDirection = Direction.Zero; + float bestDistance = float.MaxValue; + for (int i = horizontalOnly ? 2 : 0; i < blockedDirections.Length; i++) { - directions = new Vector2[] { new Vector2(1, 0), new Vector2(-1, 0) }; - availableDirections = new Vector2[2]; - } - else - { - directions = new Vector2[] { new Vector2(0, 1), new Vector2(1, 0), new Vector2(0, -1), new Vector2(-1, 0) }; - availableDirections = new Vector2[4]; - } - - int availableDirectionsNum = 0; - for (int i = 0; i < directions.Length; i++) - { - if (directions[i].Equals(discardDirection) || GridMoverTools.CheckCollisionInDirection(transform, gridPosition, directions[i])) + if (blockedDirections[i]) { continue; } - availableDirections[availableDirectionsNum] = directions[i]; - availableDirectionsNum++; - } - Vector2[] availableDirectionsTrimmed = new Vector2[availableDirectionsNum]; - // Debug.Log($"{gameObject} Number of available directions: {availableDirectionsTrimmed.Length}"); - Array.Copy(availableDirections, 0, availableDirectionsTrimmed, 0, availableDirectionsNum); - - return availableDirectionsTrimmed; - } - - Vector2 GetGridDirectionToTargetGreedy(Vector2[] availableDirections, Vector2 gridPosition, Vector2 targetGridPosition) - { - Vector2 bestDirection = Vector2.zero; - float bestDistance = float.MaxValue; - for (int i = 0; i < availableDirections.Length; i++) - { - Vector2 direction = availableDirections[i]; // Debug.Log("Evaluating direction " + direction); - float distance = Vector2.Distance(gridPosition + direction, targetGridPosition); + var direction = cardinalDirections[i]; + float distance = Vector2.Distance(gridPosition + directionVectors[(int)direction], targetGridPosition); if (distance < bestDistance) { bestDistance = distance; bestDirection = direction; } } - // Debug.Log("Closest next tile is in direction " + bestDirection); + Debug.Log($"{gameObject.name} Closest next tile is in direction {bestDirection}"); return bestDirection; } - Vector2 GetOffGridDirectionToTarget(Vector2 position, Vector2 target, Vector2 direction) + private Direction GetOffGridDirectionToTarget(Vector2 position, Vector2 target, Direction direction) { - if ((direction.x != 0 && position.x != target.x) || position.y == target.y) + if ((IsHorizontal(direction) && position.x != target.x) || position.y == target.y) { // Debug.Log($"{gameObject} getOffGridDirectionToTarget with position {position}, target {target} and direction {direction} gives movement on the X axis in direction {new Vector2(target.x-position.x, 0).normalized}"); - return new Vector2(target.x - position.x, 0).normalized; + return HorizontalToDirection(target.x - position.x); } else { // Debug.Log($"{gameObject} getOffGridDirectionToTarget with position {position}, target {target} and direction {direction} gives movement on the Y axis in direction {new Vector2(0, target.y-position.y).normalized}"); - return new Vector2(0, target.y - position.y).normalized; + return VerticalToDirection(target.y - position.y); } } @@ -526,10 +517,11 @@ namespace Marro.PacManUdon animator.SetFloat("DirX", 0); animator.SetFloat("DirY", -1); } - else if (specialLook || !direction.Equals(Vector2.zero)) + else if (specialLook || direction != Direction.Zero) { - animator.SetFloat("DirX", direction.x); - animator.SetFloat("DirY", direction.y); + var vector = GetVector(direction); + animator.SetFloat("DirX", vector.x); + animator.SetFloat("DirY", vector.y); } } diff --git a/Assets/Scripts/GhostManager.cs b/Assets/Scripts/GhostManager.cs index ca04ba9..f0d49c2 100644 --- a/Assets/Scripts/GhostManager.cs +++ b/Assets/Scripts/GhostManager.cs @@ -72,7 +72,7 @@ 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, ghostIndex); + ghosts[ghostIndex].Initialize(pelletManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex); } SubscribeToEvent(NetworkEventType.GhostUpdate); diff --git a/Assets/Scripts/GridMover.cs b/Assets/Scripts/GridMover.cs index e5ea4e4..a605d91 100644 --- a/Assets/Scripts/GridMover.cs +++ b/Assets/Scripts/GridMover.cs @@ -3,9 +3,42 @@ namespace Marro.PacManUdon using System; using UnityEngine; + public enum Direction + { + Zero = 0, Up = 1, Down = 2, Left = 4, Right = 8, UpLeft = 5, UpRight = 9, DownLeft = 6, DownRight = 10 + } + + public enum DirectionAxis + { + Horizontal = 0, + Vertical = 1, + Both = 2 + } + public abstract class GridMover : SyncedObject { - protected Vector2 direction; + protected Direction direction; + + // Cannot be static, much to my annoyance + public readonly Vector2[] directionVectors = + { + Vector2.zero, // 0 + Vector2.down, // 1 + Vector2.up, // 2 + Vector2.zero, // 3 + Vector2.left, // 4 + Vector2.down + Vector2.left, // 5 + Vector2.up + Vector2.left, // 6 + Vector2.left, // 7 + Vector2.right, // 8 + Vector2.down + Vector2.right, // 9 + Vector2.up + Vector2.right, // 10 + Vector2.right, // 11 + Vector2.zero, // 12 + Vector2.down, // 13 + Vector2.up, // 14 + Vector2.zero, // 15 + }; public virtual Vector2 GetPosition() { @@ -17,43 +50,193 @@ namespace Marro.PacManUdon transform.localPosition = new Vector3(position.x, position.y, transform.localPosition.z); } - public virtual Vector2 GetDirection() + public Vector2 GetVector(Direction direction) + { + return directionVectors[(int)direction]; + } + + public Direction GetDirection() { return direction; } - public void SetDirection(Vector2 direction) + public void SetDirection(Direction direction) { this.direction = direction; UpdateAnimator(); } + public void SetDirection(Vector2 vector) + { + direction = VectorToDirection(vector); + UpdateAnimator(); + } + + protected static Direction VectorToDirection(Vector2 vector) + { + var directionId = 0; + + if (vector.x < 0) + { + directionId = 4; + } + else if (vector.x > 0) + { + directionId = 8; + } + + if (vector.y < 0) + { + directionId += 1; + } + else if (vector.y > 0) + { + directionId += 2; + } + + return (Direction)directionId; + } + + protected static Direction HorizontalToDirection(float horizontal) + { + if (horizontal < 0) + { + return Direction.Left; + } + if (horizontal > 0) + { + return Direction.Right; + } + return Direction.Zero; + } + + protected static Direction VerticalToDirection(float vertical) + { + if (vertical < 0) + { + return Direction.Up; + } + if (vertical > 0) + { + return Direction.Down; + } + return Direction.Zero; + } + protected abstract void UpdateAnimator(); public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) { data.Append(GetPosition(), ref index); - data.Append(GetDirection(), ref index); + data.AppendAsByte((int)direction, ref index); } public void PadSyncedData(byte[] data, ref int index, NetworkEventType eventType) { - index += 16; + index += 9; } public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) { SetPosition(data.ReadVector2(ref index)); - SetDirection(data.ReadVector2(ref index)); + SetDirection((Direction)data.ReadByte(ref index)); return true; } public bool ConsumeSyncedData(byte[] data, ref int index, NetworkEventType eventType) { - index += 16; + index += 9; return true; } + + #region Utils + public static Direction GetInverseDirection(Direction direction) + { + switch (direction) + { + case Direction.Up: + return Direction.Down; + case Direction.Down: + return Direction.Up; + case Direction.Left: + return Direction.Right; + case Direction.Right: + return Direction.Left; + case Direction.UpLeft: + return Direction.DownRight; + case Direction.UpRight: + return Direction.DownLeft; + case Direction.DownLeft: + return Direction.UpRight; + case Direction.DownRight: + return Direction.UpLeft; + default: + return Direction.Zero; + } + } + + public static bool IsVertical(Direction direction) => ((int)direction & 0b0011) != 0; + public static bool IsHorizontal(Direction direction) => ((int)direction & 0b1100) != 0; + + public static Direction VerticalComponent(Direction direction) => (Direction)((int)direction & 0b0011); + public static Direction HorizontalComponent(Direction direction) => (Direction)((int)direction & 0b1100); + + public static Vector2 GetNextPosition(Vector2 currentPosition, Vector2 directionVector, float speed, float deltaTime) + { + return currentPosition + deltaTime * speed * directionVector; + } + + public static Vector2 PositionToGrid(Vector2 position) + { + return new Vector2((float)Math.Round(position.x), (float)Math.Round(position.y)); + } + + public static bool CrossesTileCenter(Vector2 currentPosition, Vector2 nextPosition, Direction direction) + { + bool result = false; + + if (IsHorizontal(direction)) + { + result = result || Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x); + } + if (IsVertical(direction)) + { + result = result || Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y); + } + + return result; + } + + public static bool CrossesTileBorder(Vector2 currentPosition, Vector2 nextPosition, Direction direction) + { + bool result = false; + + if (IsHorizontal(direction)) + { + result = result || nextPosition.x != currentPosition.x + && ((Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x) && nextPosition.x % 1 != 0) + || currentPosition.x % 1 == 0); + } + if (IsVertical(direction)) + { + result = result || nextPosition.y != currentPosition.y + && ((Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y) && nextPosition.y % 1 != 0) + || currentPosition.y % 1 == 0); + } + return result; + } + + public static bool CheckCollisionInDirection(Transform transform, Vector2 position, Vector2 direction) + { + // Debug.Log("Collision check"); + bool result = Physics.Linecast(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), 1 << 22, QueryTriggerInteraction.Ignore); + // Debug.DrawLine(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), Color.red, 1); + // Debug.Log($"{gameObject} Collision; Position {position} became {transform.parent.TransformPoint(position)}, direction {direction.normalized} became {transform.parent.TransformDirection(direction.normalized)}"); + // Debug.Log("collision check for " + position + " in direction " + direction + " returned " + result); + return result; + } + #endregion } } \ No newline at end of file diff --git a/Assets/Scripts/GridMoverTools.cs b/Assets/Scripts/GridMoverTools.cs deleted file mode 100644 index 9dbf3b9..0000000 --- a/Assets/Scripts/GridMoverTools.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace Marro.PacManUdon -{ - using System; - using UnityEngine; - - public static class GridMoverTools - { - public static Vector2 GetNextPosition(Vector2 currentPosition, Vector2 direction, float speed, float deltaTime) - { - return currentPosition + direction * speed * deltaTime; - } - - public static Vector2 PositionToGrid(Vector2 position) - { - return new Vector2((float)Math.Round(position.x), (float)Math.Round(position.y)); - } - - public static bool CrossesTileCenter(Vector2 currentPosition, Vector2 nextPosition, bool horizontal, bool vertical) - { - bool result = false; - - if (horizontal) - { - result = result || Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x); - } - if (vertical) - { - result = result || Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y); - } - - // Debug.Log($"CrossesTileCenter at currentPosition {currentPosition} with nextPosition {nextPosition}, horizontal {horizontal} and vertical {vertical} gives {result}"); - return result; - } - - public static bool CrossesTileBorder(Vector2 currentPosition, Vector2 nextPosition, bool horizontal, bool vertical) - { - bool result = false; - - if (horizontal) - { - result = result || nextPosition.x != currentPosition.x - && ((Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x) && nextPosition.x % 1 != 0) - || currentPosition.x % 1 == 0); - } - if (vertical) - { - result = result || nextPosition.y != currentPosition.y - && ((Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y) && nextPosition.y % 1 != 0) - || currentPosition.y % 1 == 0); - } - return result; - } - - public static bool CheckCollisionInDirection(Transform transform, Vector2 position, Vector2 direction) - { - // Debug.Log("Collision check"); - bool result = Physics.Linecast(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), 1 << 22, QueryTriggerInteraction.Ignore); - // Debug.DrawLine(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), Color.red, 1); - // Debug.Log($"{gameObject} Collision; Position {position} became {transform.parent.TransformPoint(position)}, direction {direction.normalized} became {transform.parent.TransformDirection(direction.normalized)}"); - // Debug.Log("collision check for " + position + " in direction " + direction + " returned " + result); - return result; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/PacMan.asset b/Assets/Scripts/PacMan.asset index 728db28..b82c113 100644 --- a/Assets/Scripts/PacMan.asset +++ b/Assets/Scripts/PacMan.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 20 + Data: 22 - Name: Entry: 7 Data: @@ -121,13 +121,19 @@ MonoBehaviour: Data: 7|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Vector2, UnityEngine.CoreModule + Data: Marro.PacManUdon.Direction, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField - Entry: 9 - Data: 7 + Entry: 7 + Data: 8|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 @@ -142,7 +148,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -163,16 +169,70 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: gameController + Data: directionVectors - Name: $v Entry: 7 - Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: gameController + Data: directionVectors - Name: k__BackingField Entry: 7 - Data: 10|System.RuntimeType, mscorlib + Data: 11|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector2[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - 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: 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: gameManager + - Name: $v + Entry: 7 + Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: gameManager + - Name: k__BackingField + Entry: 7 + Data: 14|System.RuntimeType, mscorlib - Name: Entry: 1 Data: Marro.PacManUdon.GameManager, Assembly-CSharp @@ -196,7 +256,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -220,13 +280,13 @@ MonoBehaviour: Data: input - Name: $v Entry: 7 - Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: input - Name: k__BackingField Entry: 7 - Data: 13|System.RuntimeType, mscorlib + Data: 17|System.RuntimeType, mscorlib - Name: Entry: 1 Data: Marro.PacManUdon.PlayerInput, Assembly-CSharp @@ -250,7 +310,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -271,121 +331,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: defaultSpeed + Data: pelletManager - Name: $v Entry: 7 - Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: defaultSpeed + Data: pelletManager - Name: k__BackingField Entry: 7 - Data: 16|System.RuntimeType, mscorlib + Data: 20|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Single, mscorlib + Data: Marro.PacManUdon.PelletManager, Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField Entry: 9 - Data: 16 - - 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: 17|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: powerPelletSpeed - - Name: $v - Entry: 7 - Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: powerPelletSpeed - - Name: k__BackingField - Entry: 9 - Data: 16 - - Name: k__BackingField - Entry: 9 - Data: 16 - - 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: speed - - Name: $v - Entry: 7 - Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: speed - - Name: k__BackingField - Entry: 9 - Data: 16 - - Name: k__BackingField - Entry: 9 - Data: 16 + Data: 4 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -421,19 +385,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: startPosition + Data: defaultSpeed - Name: $v Entry: 7 Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: startPosition + Data: defaultSpeed - Name: k__BackingField Entry: 7 Data: 23|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Vector3, UnityEngine.CoreModule + Data: System.Single, mscorlib - Name: Entry: 8 Data: @@ -475,16 +439,166 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: startRotation + Data: powerPelletSpeed - Name: $v Entry: 7 Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: powerPelletSpeed + - 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: 26|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: speed + - Name: $v + Entry: 7 + Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: speed + - 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: 28|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: startPosition + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: startPosition + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector3, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 30 + - 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: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: startRotation + - Name: $v + Entry: 7 + Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: startRotation - Name: k__BackingField Entry: 7 - Data: 26|System.RuntimeType, mscorlib + Data: 33|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Quaternion, UnityEngine.CoreModule @@ -493,7 +607,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 26 + Data: 33 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -508,7 +622,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -532,13 +646,13 @@ MonoBehaviour: Data: animator - Name: $v Entry: 7 - Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: animator - Name: k__BackingField Entry: 7 - Data: 29|System.RuntimeType, mscorlib + Data: 36|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Animator, UnityEngine.AnimationModule @@ -547,7 +661,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 29 + Data: 36 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -562,7 +676,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -586,13 +700,13 @@ MonoBehaviour: Data: renderer - Name: $v Entry: 7 - Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: renderer - Name: k__BackingField Entry: 7 - Data: 32|System.RuntimeType, mscorlib + Data: 39|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Renderer, UnityEngine.CoreModule @@ -601,157 +715,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 32 - - 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: 33|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: hideUntilUnfrozen - - Name: $v - Entry: 7 - Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: hideUntilUnfrozen - - Name: k__BackingField - Entry: 7 - Data: 35|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Boolean, mscorlib - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - 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 - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 38|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: kinematic - - Name: $v - Entry: 7 - Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: kinematic - - Name: k__BackingField - Entry: 9 - Data: 35 - - Name: k__BackingField - Entry: 9 - Data: 35 + Data: 39 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -787,19 +751,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: followingPredefinedPath + Data: hideUntilUnfrozen - Name: $v Entry: 7 Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: followingPredefinedPath + Data: hideUntilUnfrozen - Name: k__BackingField - Entry: 9 - Data: 35 + Entry: 7 + Data: 42|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 35 + Data: 42 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -814,7 +784,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 43|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -835,25 +805,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: predefinedPath + Data: dead - Name: $v Entry: 7 - Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: predefinedPath + Data: dead - Name: k__BackingField - Entry: 7 - Data: 44|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Vector2[], UnityEngine.CoreModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 42 - Name: k__BackingField Entry: 9 - Data: 44 + Data: 42 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -889,25 +853,163 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: predefinedPathIndex + Data: kinematic - Name: $v Entry: 7 Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: kinematic + - Name: k__BackingField + Entry: 9 + Data: 42 + - Name: k__BackingField + Entry: 9 + Data: 42 + - 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: 47|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: followingPredefinedPath + - Name: $v + Entry: 7 + Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: followingPredefinedPath + - Name: k__BackingField + Entry: 9 + Data: 42 + - Name: k__BackingField + Entry: 9 + Data: 42 + - 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: 49|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: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: predefinedPath + - 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: 51|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: predefinedPathIndex + - Name: $v + Entry: 7 + Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: predefinedPathIndex - Name: k__BackingField - Entry: 7 - Data: 47|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 8 - Name: k__BackingField Entry: 9 - Data: 47 + Data: 8 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -922,7 +1024,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 53|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -946,16 +1048,22 @@ MonoBehaviour: Data: targetDirection - Name: $v Entry: 7 - Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: targetDirection - Name: k__BackingField - Entry: 9 - Data: 7 + Entry: 7 + Data: 55|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Vector2, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 7 + Data: 55 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -970,7 +1078,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -994,16 +1102,16 @@ MonoBehaviour: Data: freezeSeconds - Name: $v Entry: 7 - Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: freezeSeconds - Name: k__BackingField Entry: 9 - Data: 16 + Data: 23 - Name: k__BackingField Entry: 9 - Data: 16 + Data: 23 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1018,7 +1126,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 52|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1042,16 +1150,16 @@ MonoBehaviour: Data: frozen - Name: $v Entry: 7 - Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: frozen - Name: k__BackingField Entry: 9 - Data: 35 + Data: 42 - Name: k__BackingField Entry: 9 - Data: 35 + Data: 42 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1066,7 +1174,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 54|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 diff --git a/Assets/Scripts/PacMan.cs b/Assets/Scripts/PacMan.cs index ad8c651..81a9d5e 100644 --- a/Assets/Scripts/PacMan.cs +++ b/Assets/Scripts/PacMan.cs @@ -7,8 +7,9 @@ namespace Marro.PacManUdon [RequireComponent(typeof(Renderer))] public class PacMan : GridMover { - private GameManager gameController; + private GameManager gameManager; private PlayerInput input; + private PelletManager pelletManager; private float defaultSpeed; private float powerPelletSpeed; private float speed; @@ -40,9 +41,10 @@ namespace Marro.PacManUdon #endregion - public void Initialize(PlayerInput input, Transform startTransform, GameManager gameController) + public void Initialize(PlayerInput input, Transform startTransform, GameManager gameManager, PelletManager pelletManager) { - this.gameController = gameController; + this.gameManager = gameManager; + this.pelletManager = pelletManager; this.input = input; animator = GetComponent(); renderer = GetComponent(); @@ -57,7 +59,7 @@ namespace Marro.PacManUdon public void Reset() { transform.SetLocalPositionAndRotation(startPosition, startRotation); - direction = Vector2.left; + direction = Direction.Left; targetDirection = Vector2.left; speed = defaultSpeed; kinematic = false; @@ -104,7 +106,7 @@ namespace Marro.PacManUdon } Vector2 position = GetPosition(); - Vector2 nextPosition = GridMoverTools.GetNextPosition(position, direction, speed, networkManager.SyncedDeltaTime); // The position pacman will move to, assuming it doens't get changed + Vector2 nextPosition = GetNextPosition(position, directionVectors[(int)direction], speed, networkManager.SyncedDeltaTime); // The position pacman will move to, assuming it doens't get changed if (!kinematic) { @@ -123,34 +125,35 @@ namespace Marro.PacManUdon private Vector2 ProcessNextPosition(Vector2 position, Vector2 nextPosition) { - if (GridMoverTools.CrossesTileCenter(position, nextPosition, direction.x != 0, false) // If pacman is moving horizontally, check if he may cross the center of a tile in that axis - && (targetDirection.x == 0 || GridMoverTools.CheckCollisionInDirection(transform, nextPosition, new Vector2(direction.x, 0)))) + if (CrossesTileCenter(position, nextPosition, Direction.Left) // If pacman is moving horizontally, check if he may cross the center of a tile in that axis + && (targetDirection.x == 0 || pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)HorizontalComponent(direction)]))) { // If the target direction is in the other axis or if we're about to run into a wall - nextPosition.x = GridMoverTools.PositionToGrid(nextPosition).x; // Snap pacman to the center of his current tile in this axis - SetDirection(new Vector2(0, direction.y)); - // Debug.Log($"{gameObject} crossed X tile center from {currentPosition}, nextPosition is now {nextPosition} and direction is now {direction}"); + nextPosition.x = PositionToGrid(nextPosition).x; // Snap pacman to the center of his current tile in this axis + SetDirection(VerticalComponent(direction)); + Debug.Log($"{gameObject} crossed X tile center from {position}, nextPosition is now {nextPosition} and direction is now {direction}"); } - if (GridMoverTools.CrossesTileCenter(position, nextPosition, false, direction.y != 0) // See comments above but now vertical - && (targetDirection.y == 0 || GridMoverTools.CheckCollisionInDirection(transform, nextPosition, new Vector2(0, direction.y)))) + if (CrossesTileCenter(position, nextPosition, Direction.Down) // See comments above but now vertical + && (targetDirection.y == 0 || pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)VerticalComponent(direction)]))) { - nextPosition.y = GridMoverTools.PositionToGrid(nextPosition).y; - SetDirection(new Vector2(direction.x, 0)); - // Debug.Log($"{gameObject} crossed Y tile center from {currentPosition} with targetDirection {targetDirection}, nextPosition is now {nextPosition} and direction is now {direction}"); + nextPosition.y = PositionToGrid(nextPosition).y; + SetDirection(HorizontalComponent(direction)); + Debug.Log($"{gameObject} crossed Y tile center from {position} with targetDirection {targetDirection}, nextPosition is now {nextPosition} and direction is now {direction}"); } Vector2 inputDirection = input.GetDirection(); - if (!inputDirection.Equals(Vector2.zero) && !inputDirection.Equals(targetDirection) // Ignore neutral input or input in our current direction - && (inputDirection.x == 0 || (Math.Round(nextPosition.y, 5) - 0.5) % 1 != 0) && (inputDirection.y == 0 || (Math.Round(nextPosition.x, 5) - 0.5) % 1 != 0) // Target grid position near the edge of a tile may not be correct, ignore inputs near the border - && !GridMoverTools.CheckCollisionInDirection(transform, nextPosition, inputDirection)) + if (!inputDirection.Equals(Vector2.zero) && !inputDirection.Equals(targetDirection) // Ignore neutral input or input in our current direction + && (inputDirection.x == 0 || (Math.Round(nextPosition.y, 5) - 0.5) % 1 != 0) // Target grid position near the edge of a tile may not be correct, ignore inputs near the border + && (inputDirection.y == 0 || (Math.Round(nextPosition.x, 5) - 0.5) % 1 != 0) + && !CheckCollisionInDirection(transform, nextPosition, inputDirection)) { // Check if the requested direction does not have a wall if (inputDirection.x != 0) { // Move in the requested direction, as well as perpundicular to it to get to the center of the tunnel - SetDirection(inputDirection + new Vector2(0, GridMoverTools.PositionToGrid(nextPosition).y - nextPosition.y).normalized); + SetDirection(inputDirection + new Vector2(0, PositionToGrid(nextPosition).y - nextPosition.y).normalized); } else { - SetDirection(inputDirection + new Vector2(GridMoverTools.PositionToGrid(nextPosition).x - nextPosition.x, 0).normalized); + SetDirection(inputDirection + new Vector2(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 @@ -165,7 +168,7 @@ namespace Marro.PacManUdon private Vector2 ProcessPredefinedPath(Vector2 position, Vector2 nextPosition) { - if (GridMoverTools.CrossesTileCenter(position, nextPosition, direction.x != 0, direction.y != 0)) + if (CrossesTileCenter(position, nextPosition, direction)) { // Find the next valid direction which isn't Vector2.zero int nextValidDirectionIndex = predefinedPathIndex; @@ -173,14 +176,14 @@ namespace Marro.PacManUdon { nextValidDirectionIndex += 1; } - if (!GridMoverTools.CheckCollisionInDirection(transform, nextPosition, predefinedPath[nextValidDirectionIndex])) + if (!CheckCollisionInDirection(transform, nextPosition, predefinedPath[nextValidDirectionIndex])) { // If we're at a Vector2.zero, we skip applying the direction and only increment. if (nextValidDirectionIndex == predefinedPathIndex) { SetDirection(predefinedPath[nextValidDirectionIndex]); SetTargetDirection(predefinedPath[nextValidDirectionIndex]); - nextPosition = GridMoverTools.PositionToGrid(nextPosition) + direction.normalized * 0.01f; + nextPosition = PositionToGrid(nextPosition) + directionVectors[(int)direction] * 0.01f; // Check if we've reached the end of the path, which includes making sure the path doesn't end on Vector2.zero do @@ -324,19 +327,19 @@ namespace Marro.PacManUdon { if (pellet.isPowerPellet) { - gameController.GotPowerPellet(pellet); + gameManager.GotPowerPellet(pellet); freezeSeconds = 0.05f; } else { - gameController.GotPellet(pellet); + gameManager.GotPellet(pellet); freezeSeconds = 0.0166666666666667f; } return; } else if (other.gameObject.GetComponent()) { - gameController.GotFruit(); + gameManager.GotFruit(); } } diff --git a/Assets/Scripts/PacManConstants.cs b/Assets/Scripts/PacManConstants.cs index 8c0534e..2be9cf1 100644 --- a/Assets/Scripts/PacManConstants.cs +++ b/Assets/Scripts/PacManConstants.cs @@ -1,8 +1,9 @@ namespace Marro.PacManUdon { using UnityEngine; + using VRC.Udon; - public enum PacManFruitType + public enum PacManFruitType { None = -1, Cherries = 0, @@ -15,7 +16,7 @@ namespace Marro.PacManUdon Key = 7 } - public enum PacManGameState + public enum PacManGameState { AttractMode, AttractModeDemo, @@ -23,14 +24,14 @@ namespace Marro.PacManUdon InGame, } - public enum PacManGhostFrozenState + public enum PacManGhostFrozenState { Frozen, FrozenIfNotCaught, NotFrozen } - public enum PacManTimeSequence + public enum PacManTimeSequence { AttractScreenIntroduction, AttractScreenDemo, @@ -49,16 +50,77 @@ namespace Marro.PacManUdon Intermission3 } - public static class PacManConstants + public enum PacManTileType { + Empty = -1, + Wall = -2, + } + + public static class PacManConstants + { + // Jagged or 2D arrays can't be static so we work with 1D arrays + public static int[] GetMazeDefinition() => new int[] { + -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, + -02, 216, 215, 214, 213, 212, 196, 195, 194, 193, 192, 191, 190, -02, -02, 178, 179, 180, 181, 182, 183, 152, 151, 150, 149, 148, 147, -02, + -02, 217, -02, -02, -02, -02, 197, -02, -02, -02, -02, -02, 189, -02, -02, 177, -02, -02, -02, -02, -02, 153, -02, -02, -02, -02, 146, -02, + -02, 003, -02, -01, -01, -02, 198, -02, -01, -01, -01, -02, 188, -02, -02, 176, -02, -01, -01, -01, -02, 154, -02, -01, -01, -02, 002, -02, + -02, 218, -02, -02, -02, -02, 199, -02, -02, -02, -02, -02, 187, -02, -02, 175, -02, -02, -02, -02, -02, 155, -02, -02, -02, -02, 145, -02, + -02, 219, 220, 221, 222, 223, 200, 201, 202, 203, 204, 205, 186, 185, 184, 174, 173, 172, 165, 164, 163, 156, 157, 158, 159, 160, 144, -02, + -02, 224, -02, -02, -02, -02, 231, -02, -02, 206, -02, -02, -02, -02, -02, -02, -02, -02, 166, -02, -02, 161, -02, -02, -02, -02, 143, -02, + -02, 225, -02, -02, -02, -02, 232, -02, -02, 207, -02, -02, -02, -02, -02, -02, -02, -02, 167, -02, -02, 162, -02, -02, -02, -02, 142, -02, + -02, 226, 227, 228, 229, 230, 233, -02, -02, 208, 209, 210, 211, -02, -02, 171, 170, 169, 168, -02, -02, 136, 137, 138, 139, 140, 141, -02, + -02, -02, -02, -02, -02, -02, 234, -02, -02, -02, -02, -02, -01, -02, -02, -01, -02, -02, -02, -02, -02, 134, -02, -02, -02, -02, -02, -02, + -01, -01, -01, -01, -01, -02, 235, -02, -02, -02, -02, -02, -01, -02, -02, -01, -02, -02, -02, -02, -02, 133, -02, -01, -01, -01, -01, -01, + -01, -01, -01, -01, -01, -02, 236, -02, -02, -01, -01, -01, -01, -01, -01, -01, -01, -01, -01, -02, -02, 132, -02, -01, -01, -01, -01, -01, + -01, -01, -01, -01, -01, -02, 237, -02, -02, -01, -02, -02, -02, -02, -02, -02, -02, -02, -01, -02, -02, 131, -02, -01, -01, -01, -01, -01, + -02, -02, -02, -02, -02, -02, 238, -02, -02, -01, -02, -01, -01, -01, -01, -01, -01, -02, -01, -02, -02, 130, -02, -02, -02, -02, -02, -02, + -01, -01, -01, -01, -01, -01, 239, -01, -01, -01, -02, -01, -01, -01, -01, -01, -01, -02, -01, -01, -01, 129, -01, -01, -01, -01, -01, -01, + -02, -02, -02, -02, -02, -02, 240, -02, -02, -01, -02, -01, -01, -01, -01, -01, -01, -02, -01, -02, -02, 128, -02, -02, -02, -02, -02, -02, + -01, -01, -01, -01, -01, -02, 241, -02, -02, -01, -02, -02, -02, -02, -02, -02, -02, -02, -01, -02, -02, 127, -02, -01, -01, -01, -01, -01, + -01, -01, -01, -01, -01, -02, 242, -02, -02, -01, -01, -01, -01, -01, -01, -01, -01, -01, -01, -02, -02, 126, -02, -01, -01, -01, -01, -01, + -01, -01, -01, -01, -01, -02, 243, -02, -02, -01, -02, -02, -02, -02, -02, -02, -02, -02, -01, -02, -02, 125, -02, -01, -01, -01, -01, -01, + -02, -02, -02, -02, -02, -02, 244, -02, -02, -01, -02, -02, -02, -02, -02, -02, -02, -02, -01, -02, -02, 124, -02, -02, -02, -02, -02, -02, + -02, 086, 087, 088, 089, 090, 091, 094, 095, 096, 097, 098, 099, -02, -02, 104, 105, 106, 107, 108, 109, 110, 123, 122, 121, 120, 119, -02, + -02, 085, -02, -02, -02, -02, 092, -02, -02, -02, -02, -02, 100, -02, -02, 103, -02, -02, -02, -02, -02, 111, -02, -02, -02, -02, 118, -02, + -02, 084, -02, -02, -02, -02, 093, -02, -02, -02, -02, -02, 101, -02, -02, 102, -02, -02, -02, -02, -02, 112, -02, -02, -02, -02, 117, -02, + -02, 000, 083, 082, -02, -02, 010, 009, 008, 007, 006, 005, 004, -01, -01, 063, 062, 061, 060, 059, 058, 057, -02, -02, 115, 116, 001, -02, + -02, -02, -02, 081, -02, -02, 011, -02, -02, 079, -02, -02, -02, -02, -02, -02, -02, -02, 064, -02, -02, 056, -02, -02, 114, -02, -02, -02, + -02, -02, -02, 080, -02, -02, 012, -02, -02, 078, -02, -02, -02, -02, -02, -02, -02, -02, 065, -02, -02, 055, -02, -02, 113, -02, -02, -02, + -02, 018, 017, 016, 015, 014, 013, -02, -02, 077, 076, 075, 074, -02, -02, 069, 068, 067, 066, -02, -02, 054, 053, 052, 051, 050, 049, -02, + -02, 019, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, 073, -02, -02, 070, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, 048, -02, + -02, 020, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, 072, -02, -02, 071, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, 047, -02, + -02, 021, 022, 023, 024, 025, 026, 027, 028, 029, 030, 031, 032, 033, 034, 035, 036, 037, 038, 039, 040, 041, 042, 043, 044, 045, 046, -02, + -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, -02, + }; + + public static int[] GetPelletIndices() => new int[] + { + 645, 670, 110, 085, 656, 655, 654, 653, 652, 651, 650, 678, 706, 734, 733, 732, + 731, 730, 729, 757, 785, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, + 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 810, + 782, 754, 753, 752, 751, 750, 749, 721, 693, 665, 664, 663, 662, 661, 660, 659, + 690, 718, 746, 745, 744, 743, 771, 799, 796, 768, 740, 739, 738, 737, 709, 681, + 703, 675, 647, 646, 617, 589, 561, 562, 563, 564, 565, 566, 594, 622, 567, 568, + 569, 570, 571, 572, 600, 628, 631, 603, 575, 576, 577, 578, 579, 580, 581, 609, + 637, 724, 696, 668, 669, 642, 614, 586, 585, 584, 583, 582, 553, 525, 497, 469, + 441, 413, 385, 357, 329, 301, 273, 245, 245, 246, 247, 248, 249, 250, 222, 194, + 166, 138, 082, 054, 053, 052, 051, 050, 049, 077, 105, 133, 161, 162, 163, 164, + 165, 189, 217, 160, 159, 158, 186, 214, 242, 241, 240, 239, 157, 156, 155, 127, + 099, 071, 043, 044, 045, 046, 047, 048, 154, 153, 152, 124, 096, 068, 040, 039, + 038, 037, 036, 035, 034, 062, 090, 118, 146, 147, 148, 149, 150, 151, 177, 205, + 233, 234, 235, 236, 033, 032, 031, 030, 029, 057, 113, 141, 142, 143, 144, 145, + 169, 197, 225, 226, 227, 228, 229, 174, 202, 230, 258, 286, 314, 342, 370, 398, + 426, 454, 482, 510, 538, + }; + public static GameObject[] ComponentsToGameObjects(Component[] components, bool skipFirstComponent = false) { if (skipFirstComponent) { - GameObject[] gameObjects = new GameObject[components.Length-1]; - for (int i = 0; i < components.Length-1; i++) + GameObject[] gameObjects = new GameObject[components.Length - 1]; + for (int i = 0; i < components.Length - 1; i++) { - gameObjects[i] = components[i+1].gameObject; + gameObjects[i] = components[i + 1].gameObject; } return gameObjects; } @@ -71,7 +133,7 @@ namespace Marro.PacManUdon } return gameObjects; } - + } public static float GetPowerPelletBlinkToggleInterval() @@ -81,9 +143,9 @@ namespace Marro.PacManUdon public static PacManFruitType GetFruitTypeForLevel(int level) { - PacManFruitType[] FruitTypePerLevel = new PacManFruitType[] + PacManFruitType[] FruitTypePerLevel = new PacManFruitType[] { - PacManFruitType.Cherries, + PacManFruitType.Cherries, PacManFruitType.Strawberry, PacManFruitType.Peach, PacManFruitType.Peach, @@ -97,15 +159,15 @@ namespace Marro.PacManUdon PacManFruitType.Bell, PacManFruitType.Key }; - if (level-1 < 0) + if (level - 1 < 0) { return PacManFruitType.None; } - if (level-1 >= FruitTypePerLevel.Length) + if (level - 1 >= FruitTypePerLevel.Length) { - return FruitTypePerLevel[FruitTypePerLevel.Length-1]; + return FruitTypePerLevel[FruitTypePerLevel.Length - 1]; } - return FruitTypePerLevel[level-1]; + return FruitTypePerLevel[level - 1]; } public static float GetGhostHomeSpeed() @@ -113,101 +175,101 @@ namespace Marro.PacManUdon return 3.5f; } - public static float GetPacManDefaultSpeedForLevel(int level) + public static float GetPacManDefaultSpeedForLevel(int level) { - if(level <= 1) return 7.576f; - if(level <= 4) return 8.523f; - if(level <= 20) return 9.470f; - return 8.523f; + if (level <= 1) return 7.576f; + if (level <= 4) return 8.523f; + if (level <= 20) return 9.470f; + return 8.523f; } public static float GetPacManPowerPelletSpeedForLevel(int level) { - if(level <= 1) return 8.523f; - if(level <= 4) return 8.996f; - return 9.470f; + if (level <= 1) return 8.523f; + if (level <= 4) return 8.996f; + return 9.470f; } public static float GetGhostDefaultSpeedForLevel(int level) { - if(level <= 1) return 7.102f; - if(level <= 4) return 8.049f; - return 8.996f; + if (level <= 1) return 7.102f; + if (level <= 4) return 8.049f; + return 8.996f; } public static float GetGhostTunnelSpeedForLevel(int level) { - if(level <= 1) return 3.788f; - if(level <= 4) return 4.261f; - return 4.735f; + if (level <= 1) return 3.788f; + if (level <= 4) return 4.261f; + return 4.735f; } - public static float GetBlinkyElroy1SpeedForLevel(int level) + public static float GetBlinkyElroy1SpeedForLevel(int level) { - if(level <= 1) return 7.576f; - if(level <= 4) return 8.523f; - return 9.470f; + if (level <= 1) return 7.576f; + if (level <= 4) return 8.523f; + return 9.470f; } - public static float GetBlinkyElroy2SpeedForLevel(int level) + public static float GetBlinkyElroy2SpeedForLevel(int level) { - if(level <= 1) return 8.049f; - if(level <= 4) return 8.996f; - return 9.943f; + if (level <= 1) return 8.049f; + if (level <= 4) return 8.996f; + return 9.943f; } - public static float GetGhostScaredSpeedForLevel(int level) + public static float GetGhostScaredSpeedForLevel(int level) { - if(level <= 1) return 4.735f; - if(level <= 4) return 5.208f; - return 5.682f; + if (level <= 1) return 4.735f; + if (level <= 4) return 5.208f; + return 5.682f; } - public static int GetElroy1PelletsRemainingForLevel(int level) + public static int GetElroy1PelletsRemainingForLevel(int level) { - if(level <= 1) return 20; - if(level <= 2) return 30; - if(level <= 5) return 40; - if(level <= 8) return 50; - if(level <= 11) return 60; - if(level <= 14) return 80; - if(level <= 18) return 100; - return 120; + if (level <= 1) return 20; + if (level <= 2) return 30; + if (level <= 5) return 40; + if (level <= 8) return 50; + if (level <= 11) return 60; + if (level <= 14) return 80; + if (level <= 18) return 100; + return 120; } - public static int GetElroy2PelletsRemainingForLevel(int level) + public static int GetElroy2PelletsRemainingForLevel(int level) { - if(level <= 1) return 10; - if(level <= 2) return 15; - if(level <= 5) return 20; - if(level <= 8) return 25; - if(level <= 11) return 30; - if(level <= 14) return 40; - if(level <= 18) return 50; - return 60; + if (level <= 1) return 10; + if (level <= 2) return 15; + if (level <= 5) return 20; + if (level <= 8) return 25; + if (level <= 11) return 30; + if (level <= 14) return 40; + if (level <= 18) return 50; + return 60; } public static float GetGhostHousePelletTimeoutLimitForLevel(int level) { - if(level <= 4) return 4; - return 3; + if (level <= 4) return 4; + return 3; } public static int[] GetGhostHousePrivatePelletCounterLimitForLevel(int level) { - if(level <= 1) return new int[] { 0, 0, 30, 60}; - if(level <= 2) return new int[] { 0, 0, 0, 50}; - return new int[] { 0, 0, 0, 0}; + if (level <= 1) return new int[] { 0, 0, 30, 60 }; + if (level <= 2) return new int[] { 0, 0, 0, 50 }; + return new int[] { 0, 0, 0, 0 }; } - public static float[] GetScatterPatternForLevel(int level) + public static float[] GetScatterPatternForLevel(int level) { - if(level <= 1) return new float[] { 7, 27, 34, 54, 59, 79, 84 }; - if(level <= 4) return new float[] { 7, 27, 34, 54, 59, 1092, 1092.0166667f}; - return new float[] { 5, 25, 30, 50, 55, 1092, 1092.0166667f}; + if (level <= 1) return new float[] { 7, 27, 34, 54, 59, 79, 84 }; + if (level <= 4) return new float[] { 7, 27, 34, 54, 59, 1092, 1092.0166667f }; + return new float[] { 5, 25, 30, 50, 55, 1092, 1092.0166667f }; } - public static float GetScaredDurationForLevel(int level) + public static float GetScaredDurationForLevel(int level) { float[] scaredDurationPerLevel = { @@ -231,18 +293,18 @@ namespace Marro.PacManUdon 1, 0 }; - if (level-1 < 0) + if (level - 1 < 0) { return scaredDurationPerLevel[0]; } - if (level-1 >= scaredDurationPerLevel.Length) + if (level - 1 >= scaredDurationPerLevel.Length) { - return scaredDurationPerLevel[scaredDurationPerLevel.Length-1]; + return scaredDurationPerLevel[scaredDurationPerLevel.Length - 1]; } - return scaredDurationPerLevel[level-1]; + return scaredDurationPerLevel[level - 1]; } - public static float GetScaredNumberOfFlashesForLevel(int level) + public static float GetScaredNumberOfFlashesForLevel(int level) { int[] scaredNumberOfFlashesPerLevel = new int[] { @@ -266,19 +328,20 @@ namespace Marro.PacManUdon 3, 0 }; - if (level-1 < 0) + if (level - 1 < 0) { return scaredNumberOfFlashesPerLevel[0]; } - if (level-1 >= scaredNumberOfFlashesPerLevel.Length) + if (level - 1 >= scaredNumberOfFlashesPerLevel.Length) { - return scaredNumberOfFlashesPerLevel[scaredNumberOfFlashesPerLevel.Length-1]; + return scaredNumberOfFlashesPerLevel[scaredNumberOfFlashesPerLevel.Length - 1]; } - return scaredNumberOfFlashesPerLevel[level-1]; + return scaredNumberOfFlashesPerLevel[level - 1]; } - public static int FruitTypeToValue(PacManFruitType fruitType) { // I can't get casting from enum to int to work so this is a workaround - switch (fruitType) + public static int FruitTypeToValue(PacManFruitType fruitType) + { // I can't get casting from enum to int to work so this is a workaround + switch (fruitType) { default: case PacManFruitType.None: diff --git a/Assets/Scripts/PelletManager.asset b/Assets/Scripts/PelletManager.asset index 3e637d5..90c0920 100644 --- a/Assets/Scripts/PelletManager.asset +++ b/Assets/Scripts/PelletManager.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 9 + Data: 10 - Name: Entry: 7 Data: @@ -530,6 +530,60 @@ MonoBehaviour: - Name: Entry: 8 Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: tilemap + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: tilemap + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32[], mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 30 + - 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: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: - Name: Entry: 13 Data: diff --git a/Assets/Scripts/PelletManager.cs b/Assets/Scripts/PelletManager.cs index 06f1ed1..76724c0 100644 --- a/Assets/Scripts/PelletManager.cs +++ b/Assets/Scripts/PelletManager.cs @@ -18,6 +18,11 @@ namespace Marro.PacManUdon byte[] syncedPelletsCollected; + int[] tilemap; + + const int mazeWidth = 28; + const int mazeHeight = 31; + public void Initialize() { gameObject.SetActive(true); @@ -32,6 +37,7 @@ namespace Marro.PacManUdon SubscribeToEvent(NetworkEventType.SyncPellets); } + #region Power pellet blink public override void SyncedUpdate() { if (!powerPelletBlinkEnabled) @@ -72,7 +78,39 @@ namespace Marro.PacManUdon { powerPelletBlinkEnabled = !frozen; } + #endregion + #region Collision + public bool IsWallUpcoming(Vector2 position, Vector2 directionVector) + { + var result = GetTileAt(position + directionVector) == (int)PacManTileType.Wall; + Debug.Log($"Is wall upcoming {result} at position {position}, direction {directionVector}"); + return result; + } + + public bool[] GetBlockedDirections(Vector2 position) + { + var results = new bool[4]; + + results[0] = IsWallUpcoming(position, Vector2.down); + results[1] = IsWallUpcoming(position, Vector2.up); + results[2] = IsWallUpcoming(position, Vector2.left); + results[3] = IsWallUpcoming(position, Vector2.right); + + return results; + } + + private int GetTileAt(Vector2 position) => tilemap[GetTilemapIndex(position)]; + + private int GetTilemapIndex(Vector2 position) + { + position = Clamp(position, 0, mazeWidth - 1, 1 - mazeHeight, 0); + var index = (int)(position.x + 0.5) - (int)(position.y - 0.5) * mazeWidth; + return index; + } + #endregion + + #region Pellet collecting public int PelletCollected(Pellet pellet) { pellet.gameObject.SetActive(false); @@ -95,6 +133,8 @@ namespace Marro.PacManUdon syncedPelletsCollected = new byte[pellets.Length/8 + 1]; PelletCollectedCount = 0; + tilemap = PacManConstants.GetMazeDefinition(); + return PelletCount; } @@ -131,5 +171,33 @@ namespace Marro.PacManUdon SetPelletsCollectedFromSync(); return true; } + #endregion + + #region Utils + private static Vector2 Clamp(Vector2 vector, float xMin, float xMax, float yMin, float yMax) + { + if (vector.x < xMin) + { + vector.x = xMin; + } + + if (vector.x > xMax) + { + vector.x = xMax; + } + + if (vector.y < yMin) + { + vector.y = yMin; + } + + if (vector.y > yMax) + { + vector.y = yMax; + } + + return vector; + } + #endregion } } \ No newline at end of file diff --git a/Assets/Scripts/Sequences/AttractScreenIntroduction.cs b/Assets/Scripts/Sequences/AttractScreenIntroduction.cs index 93d9bdb..550b6aa 100644 --- a/Assets/Scripts/Sequences/AttractScreenIntroduction.cs +++ b/Assets/Scripts/Sequences/AttractScreenIntroduction.cs @@ -90,7 +90,7 @@ namespace Marro.PacManUdon pacMan.SetKinematic(true); pacMan.SetActive(true); pacMan.SetPosition(attractScreenElements[16].transform.localPosition); - pacMan.SetDirection(Vector2.left); + pacMan.SetDirection(Direction.Left); ghostManager.RestartLevel(); ghostManager.SetLevel(2); @@ -100,7 +100,7 @@ namespace Marro.PacManUdon for (int i = 0; i < ghosts.Length; i++) { ghosts[i].SetPosition(attractScreenElements[17 + i].transform.localPosition); - ghosts[i].SetDirection(Vector2.left); + ghosts[i].SetDirection(Direction.Left); ghosts[i].SetState(PacManGhostState.Normal); } break; @@ -119,7 +119,7 @@ namespace Marro.PacManUdon case 18: // Turn PacMan around after eating power pellet - pacMan.SetDirection(Vector2.right); + pacMan.SetDirection(Direction.Right); pacMan.SetTargetDirection(Vector2.right); break; diff --git a/Assets/Scripts/Sequences/Intermission1.cs b/Assets/Scripts/Sequences/Intermission1.cs index c7f7b93..3200dca 100644 --- a/Assets/Scripts/Sequences/Intermission1.cs +++ b/Assets/Scripts/Sequences/Intermission1.cs @@ -26,14 +26,14 @@ namespace Marro.PacManUdon pacMan.SetKinematic(true); pacMan.SetActive(true); pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition); - pacMan.SetDirection(Vector2.left); + pacMan.SetDirection(Direction.Left); ghostManager.SetLevel(5); ghostManager.SetKinematic(true); ghostManager.gameObject.SetActive(true); blinky.SetElroy(2); blinky.SetPosition(intermissionScreenElements[1].transform.localPosition); - blinky.SetDirection(Vector2.left); + blinky.SetDirection(Direction.Left); blinky.SetState(PacManGhostState.Normal); SetFrozen(false); @@ -46,14 +46,14 @@ namespace Marro.PacManUdon // Reached end, make ghost scared and turn around blinky.BecomeScared(); blinky.SetPosition(intermissionScreenElements[3].transform.localPosition); - pacMan.SetDirection(Vector2.zero); + pacMan.SetDirection(Direction.Zero); pacMan.SetPosition(intermissionScreenElements[2].transform.localPosition); pacMan.SetPowerPellet(true); break; case 4: // Pacman starts chasing ghosts - pacMan.SetDirection(Vector2.right); + pacMan.SetDirection(Direction.Right); pacMan.BecomeBig(); break; case 5: diff --git a/Assets/Scripts/Sequences/Intermission2.cs b/Assets/Scripts/Sequences/Intermission2.cs index 5fc4668..588e5f8 100644 --- a/Assets/Scripts/Sequences/Intermission2.cs +++ b/Assets/Scripts/Sequences/Intermission2.cs @@ -34,14 +34,14 @@ namespace Marro.PacManUdon pacMan.SetKinematic(true); pacMan.SetActive(true); pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition); - pacMan.SetDirection(Vector2.left); + pacMan.SetDirection(Direction.Left); ghostManager.SetLevel(5); ghostManager.SetKinematic(true); ghostManager.gameObject.SetActive(true); blinky.SetElroy(2); blinky.SetPosition(intermissionScreenElements[1].transform.localPosition); - blinky.SetDirection(Vector2.left); + blinky.SetDirection(Direction.Left); blinky.SetState(PacManGhostState.Normal); SetFrozen(false); @@ -65,16 +65,16 @@ namespace Marro.PacManUdon case 8: // Blinky sprite updates with broken cover blinky.SetSpecialLook(true); - blinky.SetDirection(Vector2.up); + blinky.SetDirection(Direction.Up); blinky.SetPosition(blinky.GetPosition() + new Vector2(-0.250f, 0f)); break; case 9: // Blinky looks at broken cover - blinky.SetDirection(Vector2.down); + blinky.SetDirection(Direction.Down); break; case 10: // Cutscene starts to unload - blinky.SetDirection(Vector2.zero); + blinky.SetDirection(Direction.Zero); break; case 11: // End cutscene diff --git a/Assets/Scripts/Sequences/Intermission3.cs b/Assets/Scripts/Sequences/Intermission3.cs index 366ce85..e01d943 100644 --- a/Assets/Scripts/Sequences/Intermission3.cs +++ b/Assets/Scripts/Sequences/Intermission3.cs @@ -26,14 +26,14 @@ namespace Marro.PacManUdon pacMan.SetKinematic(true); pacMan.SetActive(true); pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition); - pacMan.SetDirection(Vector2.left); + pacMan.SetDirection(Direction.Left); ghostManager.SetLevel(5); ghostManager.SetKinematic(true); ghostManager.gameObject.SetActive(true); blinky.SetElroy(2); blinky.SetPosition(intermissionScreenElements[1].transform.localPosition); - blinky.SetDirection(Vector2.left); + blinky.SetDirection(Direction.Left); blinky.SetState(PacManGhostState.Normal); blinky.SetSpecialLook(true); @@ -45,13 +45,13 @@ namespace Marro.PacManUdon break; case 3: // Reached end, freeze - pacMan.SetDirection(Vector2.zero); - blinky.SetDirection(Vector2.zero); + pacMan.SetDirection(Direction.Zero); + blinky.SetDirection(Direction.Zero); break; case 4: // Ghost runs back on screen blinky.SetPosition(intermissionScreenElements[3].transform.localPosition); - blinky.SetDirection(Vector2.right); + blinky.SetDirection(Direction.Right); break; case 5: // End cutscene diff --git a/Assets/Scripts/Teleporter.cs b/Assets/Scripts/Teleporter.cs index 40005c5..7e9b7dc 100644 --- a/Assets/Scripts/Teleporter.cs +++ b/Assets/Scripts/Teleporter.cs @@ -2,61 +2,21 @@ { using UdonSharp; using UnityEngine; - using VRC.SDKBase; - using VRC.Udon; - enum Direction - { - Any, - Up, - Left, - Down, - Right - } public class Teleporter : UdonSharpBehaviour { - [SerializeField] private Direction direction = Direction.Any; + [SerializeField] private Direction direction = Direction.Zero; [SerializeField] private Transform target; void OnTriggerEnter(Collider other) { GridMover gridMover = other.gameObject.GetComponent(); - if (gridMover == null) + if (gridMover == null || gridMover.GetDirection() != direction) { return; } - switch (direction) - { - case Direction.Up: - if (gridMover.GetDirection().y < 0) - { - return; - } - break; - case Direction.Down: - if (gridMover.GetDirection().y > 0) - { - return; - } - break; - case Direction.Left: - if (gridMover.GetDirection().x > 0) - { - return; - } - break; - case Direction.Right: - if (gridMover.GetDirection().x < 0) - { - return; - } - break; - default: - break; - } - gridMover.SetPosition(gridMover.GetPosition() + (Vector2)(target.localPosition - transform.localPosition)); } } diff --git a/Assets/Test stuff/MazeDefinitionGenerator.asset b/Assets/Test stuff/MazeDefinitionGenerator.asset new file mode 100644 index 0000000..ba06c41 --- /dev/null +++ b/Assets/Test stuff/MazeDefinitionGenerator.asset @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: MazeDefinitionGenerator + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: ea99e044f80fed446bb669640608f521, type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 30a9bec71a4b36a41a9b6ee899bef38c, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 0 + hasInteractEvent: 0 + scriptID: 6724330659013342737 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Assets/Test stuff/MazeDefinitionGenerator.asset.meta b/Assets/Test stuff/MazeDefinitionGenerator.asset.meta new file mode 100644 index 0000000..c5b4c07 --- /dev/null +++ b/Assets/Test stuff/MazeDefinitionGenerator.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 909752e684c57f24093795e3ba5e2c80 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Test stuff/MazeDefinitionGenerator.cs b/Assets/Test stuff/MazeDefinitionGenerator.cs new file mode 100644 index 0000000..d93f6ac --- /dev/null +++ b/Assets/Test stuff/MazeDefinitionGenerator.cs @@ -0,0 +1,113 @@ + +using Marro.PacManUdon; +using UdonSharp; +using UnityEngine; +using VRC.SDKBase; +using VRC.Udon; + +public class MazeDefinitionGenerator : UdonSharpBehaviour +{ + void Start() + { + GetMazeMap(); + } + + private void GetMazeMap() + { + var pellets = GetComponentsInChildren(includeInactive: true); + + var width = 28; + var height = 31; + int[] map = new int[width * height]; + int[] pelletLocations = new int[pellets.Length]; + var collisionMap = GetCollisionMap(); + + for (int i = 0; i < map.Length; i++) + { + if (collisionMap[i]) + { + map[i] = (int)PacManTileType.Wall; + } + else + { + map[i] = (int)PacManTileType.Empty; + } + } + + for (int i = 0; i < pellets.Length; i++) + { + Pellet pellet = pellets[i]; + var position = GridMover.PositionToGrid(new Vector2(pellet.transform.localPosition.x, - pellet.transform.localPosition.y)); + var index = (int)position.x + (int)position.y * width; + map[index] = i; + pelletLocations[i] = index; + } + + var result = ""; + for (int i = 0; i < map.Length; i++) + { + if (map[i] < 0) + { + result += $"{map[i]:00}, "; + } + else + { + result += $"{map[i]:000}, "; + } + + if (i % width == width - 1) + { + result += "\n"; + } + } + + Debug.Log(result); + + result = ""; + for (int i = 0; i < pelletLocations.Length; i++) + { + result += $"{pelletLocations[i]:000}, "; + + if (i % 16 == 15) + { + result += "\n"; + } + } + + Debug.Log(result); + } + + public static bool[] GetCollisionMap() => new bool[] { + true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true , + true, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, true , + true, false, true, true, true, true, false, true, true, true, true, true, false, true, true, false, true, true, true, true, true, false, true, true, true, true, false, true , + true, false, true, false, false, true, false, true, false, false, false, true, false, true, true, false, true, false, false, false, true, false, true, false, false, true, false, true , + true, false, true, true, true, true, false, true, true, true, true, true, false, true, true, false, true, true, true, true, true, false, true, true, true, true, false, true , + true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true , + true, false, true, true, true, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, true, true, true, false, true , + true, false, true, true, true, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, true, true, true, false, true , + true, false, false, false, false, false, false, true, true, false, false, false, false, true, true, false, false, false, false, true, true, false, false, false, false, false, false, true , + true, true, true, true, true, true, false, true, true, true, true, true, false, true, true, false, true, true, true, true, true, false, true, true, true, true, true, true , + false, false, false, false, false, true, false, true, true, true, true, true, false, true, true, false, true, true, true, true, true, false, true, false, false, false, false, false , + false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, true, true, false, true, false, false, false, false, false , + false, false, false, false, false, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, false, false, false, false, false , + true, true, true, true, true, true, false, true, true, false, true, false, false, false, false, false, false, true, false, true, true, false, true, true, true, true, true, true , + false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false , + true, true, true, true, true, true, false, true, true, false, true, false, false, false, false, false, false, true, false, true, true, false, true, true, true, true, true, true , + false, false, false, false, false, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, false, false, false, false, false , + false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, true, true, false, true, false, false, false, false, false , + false, false, false, false, false, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, false, false, false, false, false , + true, true, true, true, true, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, true, true, true, true, true , + true, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, true , + true, false, true, true, true, true, false, true, true, true, true, true, false, true, true, false, true, true, true, true, true, false, true, true, true, true, false, true , + true, false, true, true, true, true, false, true, true, true, true, true, false, true, true, false, true, true, true, true, true, false, true, true, true, true, false, true , + true, false, false, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, true , + true, true, true, false, true, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, true, false, true, true, true , + true, true, true, false, true, true, false, true, true, false, true, true, true, true, true, true, true, true, false, true, true, false, true, true, false, true, true, true , + true, false, false, false, false, false, false, true, true, false, false, false, false, true, true, false, false, false, false, true, true, false, false, false, false, false, false, true , + true, false, true, true, true, true, true, true, true, true, true, true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false, true , + true, false, true, true, true, true, true, true, true, true, true, true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false, true , + true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true , + true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true + }; +} diff --git a/Assets/Scripts/GridMoverTools.cs.meta b/Assets/Test stuff/MazeDefinitionGenerator.cs.meta similarity index 83% rename from Assets/Scripts/GridMoverTools.cs.meta rename to Assets/Test stuff/MazeDefinitionGenerator.cs.meta index b3a059a..5298d96 100644 --- a/Assets/Scripts/GridMoverTools.cs.meta +++ b/Assets/Test stuff/MazeDefinitionGenerator.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f317309f5509067439e01d1111249555 +guid: 30a9bec71a4b36a41a9b6ee899bef38c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Test stuff/TestBallManager.cs b/Assets/Test stuff/TestBallManager.cs index c8bf63d..364ec48 100644 --- a/Assets/Test stuff/TestBallManager.cs +++ b/Assets/Test stuff/TestBallManager.cs @@ -6,6 +6,7 @@ using UnityEngine; using UnityEngine.UI; using VRC.SDKBase; using VRC.Udon; +using UnityEngine.Tilemaps; public class TestBallManager : UdonSharpBehaviour {