Compare commits

...

32 Commits

Author SHA1 Message Date
3be8d2f6a6 Fixed PacMan speed 2026-06-23 18:18:17 +02:00
875d0ad5f0 Fixed pellet sync 2026-06-23 14:45:30 +02:00
378d6bc7a7 Refactored input 2026-06-23 13:00:48 +02:00
540cfe16ab Amend 2026-06-22 18:50:26 +02:00
b688b4739b More better sync 2026-06-22 18:44:53 +02:00
1252933ca4 Improving sync 2026-06-22 18:31:16 +02:00
d6b870de79 SoundManager sync 2026-06-22 16:03:46 +02:00
8a6f1b482b Cleanup 2026-06-22 15:51:59 +02:00
18499ab576 More sync 2026-06-22 15:51:55 +02:00
a32df1bd09 Simplified GhostManager restart more 2026-06-22 15:34:02 +02:00
d739c9d7b5 Refactored pelletCollectedCount 2026-06-22 15:21:48 +02:00
4ba203b1de Refactored starting new level 2026-06-22 15:20:43 +02:00
7f87a9779b Expanded sync 2026-06-22 15:02:22 +02:00
99556b81b1 Simplified PacMan state 2026-06-22 15:01:57 +02:00
ca116ac77f Removed clutter from log 2026-06-22 13:35:32 +02:00
e431dab042 Fixed ghost caught queue 2026-06-22 13:11:00 +02:00
cb975c24b2 Fixed desync issue for PacMan moves 2026-06-20 14:12:18 +02:00
a4733b33b8 Applied prefab 2026-06-20 12:09:36 +02:00
95bbbcc5e2 Amend 2026-06-19 21:02:51 +02:00
74e6493108 Bunch of cleaning 2026-06-19 21:01:01 +02:00
b3d6ebaf67 Updated wait for start logic 2026-06-19 15:03:15 +02:00
420bef5862 Flipped up and down in code 2026-06-19 13:35:09 +02:00
8d23d1812f Simplified ghost starting direction logic 2026-06-19 13:01:19 +02:00
0a815c7a50 Update 2026-06-19 12:55:05 +02:00
a5d3546cf0 Comment 2026-06-19 12:54:43 +02:00
77ba7ec9c6 Fixed ghost blink 2026-06-19 12:53:58 +02:00
46e1207c37 Fixed death animation 2026-06-19 12:48:04 +02:00
1a6d7875f6 Animation refactor mostly done 2026-06-18 21:58:42 +02:00
f44929c109 Cleaning 2026-06-18 11:59:21 +02:00
e4ffe97c03 Ghost look ahead 2026-06-18 11:41:23 +02:00
64e445e8a6 Renamed CollisionManager 2026-06-18 11:03:56 +02:00
a7d1adf175 Ghost - PacMan collision detection 2026-06-17 14:12:36 +02:00
67 changed files with 4501 additions and 4697 deletions

View File

@@ -8,25 +8,9 @@ BlendTree:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Caught m_Name: Caught
m_Childs: m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: b7fa9ace8554cea4f9fb60fd49d46003, type: 2}
m_Threshold: 0
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: e78691864c89f71408d1c60387bfbb68, type: 2}
m_Threshold: 0.33333334
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 36b0773acb645d54386957b2ee95b9ae, type: 2} m_Motion: {fileID: 7400000, guid: 36b0773acb645d54386957b2ee95b9ae, type: 2}
m_Threshold: 0.6666667 m_Threshold: 1
m_Position: {x: 0, y: 1} m_Position: {x: 0, y: 1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
@@ -34,19 +18,35 @@ BlendTree:
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: f0e74ae0e0fa68941a3801f395aae18e, type: 2} m_Motion: {fileID: 7400000, guid: f0e74ae0e0fa68941a3801f395aae18e, type: 2}
m_Threshold: 1 m_Threshold: 2
m_Position: {x: 0, y: -1} m_Position: {x: 0, y: -1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: GhostType m_DirectBlendParameter: GhostType
m_Mirror: 0 m_Mirror: 0
m_BlendParameter: DirX - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: e78691864c89f71408d1c60387bfbb68, type: 2}
m_Threshold: 4
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: b7fa9ace8554cea4f9fb60fd49d46003, type: 2}
m_Threshold: 8
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
m_BlendParameter: Direction
m_BlendParameterY: DirY m_BlendParameterY: DirY
m_MinThreshold: 0 m_MinThreshold: 1
m_MaxThreshold: 1 m_MaxThreshold: 8
m_UseAutomaticThresholds: 1 m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0 m_NormalizedBlendValues: 0
m_BlendType: 1 m_BlendType: 0
--- !u!206 &-8944447067464121002 --- !u!206 &-8944447067464121002
BlendTree: BlendTree:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@@ -56,24 +56,16 @@ BlendTree:
m_Name: Special m_Name: Special
m_Childs: m_Childs:
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 7285e9dfd47eeb64f8a359c3d14be984, type: 2} m_Motion: {fileID: 7400000, guid: 2e01a9fa01711c949a6922e3ebaece0f, type: 2}
m_Threshold: 0 m_Threshold: 0
m_Position: {x: 1, y: 0} m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: DirX
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: aaf4617f2ca36da40883d1c0fa350dbc, type: 2}
m_Threshold: 0.25
m_Position: {x: -1, y: 0}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: DirX m_DirectBlendParameter: DirX
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 85bb4d19537fb1d429f9b123bc9d9c00, type: 2} m_Motion: {fileID: 7400000, guid: 85bb4d19537fb1d429f9b123bc9d9c00, type: 2}
m_Threshold: 0.5 m_Threshold: 1
m_Position: {x: 0, y: 1} m_Position: {x: 0, y: 1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
@@ -81,27 +73,35 @@ BlendTree:
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 454d1764e1b7a1946808d4221d71c6c5, type: 2} m_Motion: {fileID: 7400000, guid: 454d1764e1b7a1946808d4221d71c6c5, type: 2}
m_Threshold: 0.75 m_Threshold: 2
m_Position: {x: 0, y: -1} m_Position: {x: 0, y: -1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: DirX m_DirectBlendParameter: DirX
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 2e01a9fa01711c949a6922e3ebaece0f, type: 2} m_Motion: {fileID: 7400000, guid: aaf4617f2ca36da40883d1c0fa350dbc, type: 2}
m_Threshold: 1 m_Threshold: 4
m_Position: {x: 0, y: 0} m_Position: {x: -1, y: 0}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: DirX m_DirectBlendParameter: DirX
m_Mirror: 0 m_Mirror: 0
m_BlendParameter: DirX - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 7285e9dfd47eeb64f8a359c3d14be984, type: 2}
m_Threshold: 8
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: DirX
m_Mirror: 0
m_BlendParameter: Direction
m_BlendParameterY: DirY m_BlendParameterY: DirY
m_MinThreshold: 0 m_MinThreshold: 0
m_MaxThreshold: 1 m_MaxThreshold: 8
m_UseAutomaticThresholds: 1 m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0 m_NormalizedBlendValues: 0
m_BlendType: 1 m_BlendType: 0
--- !u!206 &-6725170829935541210 --- !u!206 &-6725170829935541210
BlendTree: BlendTree:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@@ -110,25 +110,9 @@ BlendTree:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Inky m_Name: Inky
m_Childs: m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 802f1a2ffb945bd4ba7c70c31c7399e1, type: 2}
m_Threshold: 0
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: ce5667efe0f28ad4ba4ac1430a737dab, type: 2}
m_Threshold: 0.33333334
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 9894cddcecedab845ae42c087acf40a8, type: 2} m_Motion: {fileID: 7400000, guid: 9894cddcecedab845ae42c087acf40a8, type: 2}
m_Threshold: 0.6666667 m_Threshold: 1
m_Position: {x: 0, y: 1} m_Position: {x: 0, y: 1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
@@ -136,19 +120,35 @@ BlendTree:
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 3df116c3435334949a1acad965ecba8b, type: 2} m_Motion: {fileID: 7400000, guid: 3df116c3435334949a1acad965ecba8b, type: 2}
m_Threshold: 1 m_Threshold: 2
m_Position: {x: 0, y: -1} m_Position: {x: 0, y: -1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: GhostType m_DirectBlendParameter: GhostType
m_Mirror: 0 m_Mirror: 0
m_BlendParameter: DirX - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: ce5667efe0f28ad4ba4ac1430a737dab, type: 2}
m_Threshold: 4
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 802f1a2ffb945bd4ba7c70c31c7399e1, type: 2}
m_Threshold: 8
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
m_BlendParameter: Direction
m_BlendParameterY: DirY m_BlendParameterY: DirY
m_MinThreshold: 0 m_MinThreshold: 1
m_MaxThreshold: 1 m_MaxThreshold: 8
m_UseAutomaticThresholds: 1 m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0 m_NormalizedBlendValues: 0
m_BlendType: 1 m_BlendType: 0
--- !u!1102 &-5396122242781941074 --- !u!1102 &-5396122242781941074
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
@@ -183,25 +183,9 @@ BlendTree:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Blinky m_Name: Blinky
m_Childs: m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 456e9eb70ceaf434186cbc77f60bcd68, type: 2}
m_Threshold: 0
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostState
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: de276d8cc3b87d540aaa3406ce645c2f, type: 2}
m_Threshold: 0.33333334
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostState
m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 33a8bfdc4f32c8c48a25e7ced8ea7816, type: 2} m_Motion: {fileID: 7400000, guid: 33a8bfdc4f32c8c48a25e7ced8ea7816, type: 2}
m_Threshold: 0.6666667 m_Threshold: 1
m_Position: {x: 0, y: 1} m_Position: {x: 0, y: 1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
@@ -209,19 +193,35 @@ BlendTree:
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: d3a6c5069daf7f842919751122a63959, type: 2} m_Motion: {fileID: 7400000, guid: d3a6c5069daf7f842919751122a63959, type: 2}
m_Threshold: 1 m_Threshold: 2
m_Position: {x: 0, y: -1} m_Position: {x: 0, y: -1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: GhostState m_DirectBlendParameter: GhostState
m_Mirror: 0 m_Mirror: 0
m_BlendParameter: DirX - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: de276d8cc3b87d540aaa3406ce645c2f, type: 2}
m_Threshold: 4
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostState
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 456e9eb70ceaf434186cbc77f60bcd68, type: 2}
m_Threshold: 8
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostState
m_Mirror: 0
m_BlendParameter: Direction
m_BlendParameterY: DirY m_BlendParameterY: DirY
m_MinThreshold: 0 m_MinThreshold: 1
m_MaxThreshold: 1 m_MaxThreshold: 8
m_UseAutomaticThresholds: 1 m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0 m_NormalizedBlendValues: 0
m_BlendType: 1 m_BlendType: 0
--- !u!206 &-994243735496022530 --- !u!206 &-994243735496022530
BlendTree: BlendTree:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@@ -230,25 +230,9 @@ BlendTree:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Clyde m_Name: Clyde
m_Childs: m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: c3139552050fc45418fb2068d756cf5b, type: 2}
m_Threshold: 0
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 2e17027ea2c6d3643aaf6a75315d1171, type: 2}
m_Threshold: 0.33333334
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: e9f01727f466f0f4983d7e48a06427a7, type: 2} m_Motion: {fileID: 7400000, guid: e9f01727f466f0f4983d7e48a06427a7, type: 2}
m_Threshold: 0.6666667 m_Threshold: 1
m_Position: {x: 0, y: 1} m_Position: {x: 0, y: 1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
@@ -256,19 +240,35 @@ BlendTree:
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 6d653efb9a144174babda398c7b00b8c, type: 2} m_Motion: {fileID: 7400000, guid: 6d653efb9a144174babda398c7b00b8c, type: 2}
m_Threshold: 1 m_Threshold: 2
m_Position: {x: 0, y: -1} m_Position: {x: 0, y: -1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: GhostType m_DirectBlendParameter: GhostType
m_Mirror: 0 m_Mirror: 0
m_BlendParameter: DirX - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 2e17027ea2c6d3643aaf6a75315d1171, type: 2}
m_Threshold: 4
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: c3139552050fc45418fb2068d756cf5b, type: 2}
m_Threshold: 8
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
m_BlendParameter: Direction
m_BlendParameterY: DirY m_BlendParameterY: DirY
m_MinThreshold: 0 m_MinThreshold: 1
m_MaxThreshold: 1 m_MaxThreshold: 8
m_UseAutomaticThresholds: 1 m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0 m_NormalizedBlendValues: 0
m_BlendType: 1 m_BlendType: 0
--- !u!91 &9100000 --- !u!91 &9100000
AnimatorController: AnimatorController:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -278,24 +278,18 @@ AnimatorController:
m_Name: Ghost m_Name: Ghost
serializedVersion: 5 serializedVersion: 5
m_AnimatorParameters: m_AnimatorParameters:
- m_Name: DirX - m_Name: Direction
m_Type: 1 m_Type: 1
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 0}
- m_Name: DirY
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: GhostType - m_Name: GhostType
m_Type: 1 m_Type: 1
m_DefaultFloat: 1 m_DefaultFloat: 1
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 0}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 5 - serializedVersion: 5
m_Name: Base Layer m_Name: Base Layer
@@ -317,25 +311,9 @@ BlendTree:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Pinky m_Name: Pinky
m_Childs: m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: c4d80fdae68078f4f999ae9bd0dbad98, type: 2}
m_Threshold: 0
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: ba690f8352f83d44db9fe20b91f9bdb8, type: 2}
m_Threshold: 0.33333334
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: ab238cd16cad7744fbb93c2da0424514, type: 2} m_Motion: {fileID: 7400000, guid: ab238cd16cad7744fbb93c2da0424514, type: 2}
m_Threshold: 0.6666667 m_Threshold: 1
m_Position: {x: 0, y: 1} m_Position: {x: 0, y: 1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
@@ -343,19 +321,35 @@ BlendTree:
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 0e98f733efc54a14a91d76815115d096, type: 2} m_Motion: {fileID: 7400000, guid: 0e98f733efc54a14a91d76815115d096, type: 2}
m_Threshold: 1 m_Threshold: 2
m_Position: {x: 0, y: -1} m_Position: {x: 0, y: -1}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: GhostType m_DirectBlendParameter: GhostType
m_Mirror: 0 m_Mirror: 0
m_BlendParameter: DirX - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: ba690f8352f83d44db9fe20b91f9bdb8, type: 2}
m_Threshold: 4
m_Position: {x: -1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: c4d80fdae68078f4f999ae9bd0dbad98, type: 2}
m_Threshold: 8
m_Position: {x: 1, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: GhostType
m_Mirror: 0
m_BlendParameter: Direction
m_BlendParameterY: DirY m_BlendParameterY: DirY
m_MinThreshold: 0 m_MinThreshold: 1
m_MaxThreshold: 1 m_MaxThreshold: 8
m_UseAutomaticThresholds: 1 m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0 m_NormalizedBlendValues: 0
m_BlendType: 1 m_BlendType: 0
--- !u!1107 &1877551748267460816 --- !u!1107 &1877551748267460816
AnimatorStateMachine: AnimatorStateMachine:
serializedVersion: 6 serializedVersion: 6

View File

@@ -1,30 +1,5 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-9221672682127973356
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Reset
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 3691335081698814266}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-6692956035035760530 --- !u!1102 &-6692956035035760530
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
@@ -32,11 +7,11 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Alive m_Name: PacMan
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: m_Transitions:
- {fileID: 6237702739743855209} - {fileID: -4194104563410422136}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
@@ -52,21 +27,22 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &-5351155063058543854 --- !u!1102 &-6650627269168583366
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Dead m_Name: PacManDead
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: [] m_Transitions:
- {fileID: 3269978377910821223}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
m_WriteDefaultValues: 0 m_WriteDefaultValues: 1
m_Mirror: 0 m_Mirror: 0
m_SpeedParameterActive: 0 m_SpeedParameterActive: 0
m_MirrorParameterActive: 0 m_MirrorParameterActive: 0
@@ -78,6 +54,31 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1101 &-4194104563410422136
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: State
m_EventTreshold: 3
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6650627269168583366}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.21924293
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!206 &-2066582439274221996 --- !u!206 &-2066582439274221996
BlendTree: BlendTree:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@@ -92,52 +93,91 @@ BlendTree:
m_Position: {x: 0, y: 0} m_Position: {x: 0, y: 0}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: Direction m_DirectBlendParameter: State
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 946abf85568070046b684c122ab8c4d3, type: 2} m_Motion: {fileID: 6902226148018916867}
m_Threshold: 0.25
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: Blend
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 73786a7794bff2a4cab6595789479a9a, type: 2}
m_Threshold: 0.5
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: Blend
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 13e7b0ee5b399f6469049de82d79df18, type: 2}
m_Threshold: 0.75
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: Blend
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: d21f099d8860b8541960bb36f8ec4eac, type: 2}
m_Threshold: 1 m_Threshold: 1
m_Position: {x: 0, y: 0} m_Position: {x: 0, y: 0}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: Blend m_DirectBlendParameter: State
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: a28e7bee3098d0a4996a108a60ccf4c0, type: 2} m_Motion: {fileID: -363858950277856849}
m_Threshold: 1.25 m_Threshold: 2
m_Position: {x: 0, y: 0} m_Position: {x: 0, y: 0}
m_TimeScale: 1 m_TimeScale: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_DirectBlendParameter: Direction m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: a28e7bee3098d0a4996a108a60ccf4c0, type: 2}
m_Threshold: 3
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 60532b76a26184441b2940a09b1bc07e, type: 2}
m_Threshold: 4
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
m_BlendParameter: State
m_BlendParameterY: Blend
m_MinThreshold: 0
m_MaxThreshold: 4
m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0
m_BlendType: 0
--- !u!206 &-363858950277856849
BlendTree:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Stopped
m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: c3664638441f28a43ae34a14711f1bb8, type: 2}
m_Threshold: 1
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: bfa17ff437ea1c54cb39e122f0b21896, type: 2}
m_Threshold: 2
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 8f4fe9b8c3a3716418e0d6666757e956, type: 2}
m_Threshold: 4
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 014d5ceffb960844099b49fc63651f78, type: 2}
m_Threshold: 8
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0 m_Mirror: 0
m_BlendParameter: Direction m_BlendParameter: Direction
m_BlendParameterY: Blend m_BlendParameterY: Blend
m_MinThreshold: 0 m_MinThreshold: 1
m_MaxThreshold: 1.25 m_MaxThreshold: 8
m_UseAutomaticThresholds: 0 m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0 m_NormalizedBlendValues: 0
m_BlendType: 0 m_BlendType: 0
@@ -150,14 +190,8 @@ AnimatorController:
m_Name: PacMan m_Name: PacMan
serializedVersion: 5 serializedVersion: 5
m_AnimatorParameters: m_AnimatorParameters:
- m_Name: Dead - m_Name: State
m_Type: 4 m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Eating
m_Type: 4
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
@@ -168,12 +202,6 @@ AnimatorController:
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 9100000}
- m_Name: Reset
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 5 - serializedVersion: 5
m_Name: Base Layer m_Name: Base Layer
@@ -187,56 +215,7 @@ AnimatorController:
m_IKPass: 0 m_IKPass: 0
m_SyncedLayerAffectsTiming: 0 m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 9100000}
--- !u!1101 &1948315071244049044 --- !u!1101 &3269978377910821223
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6692956035035760530}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.01
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &3691335081698814266
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PacManInitial
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1948315071244049044}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 66f7552143c8ca6458831daadd2eafc0, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &6237702739743855209
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@@ -244,23 +223,70 @@ AnimatorStateTransition:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: m_Name:
m_Conditions: m_Conditions:
- m_ConditionMode: 1 - m_ConditionMode: 4
m_ConditionEvent: Dead m_ConditionEvent: State
m_EventTreshold: 0 m_EventTreshold: 4
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -5351155063058543854} m_DstState: {fileID: -6692956035035760530}
m_Solo: 0 m_Solo: 0
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0 m_TransitionDuration: 0
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.16666669 m_ExitTime: 0.8611111
m_HasExitTime: 0 m_HasExitTime: 0
m_HasFixedDuration: 1 m_HasFixedDuration: 0
m_InterruptionSource: 0 m_InterruptionSource: 0
m_OrderedInterruption: 1 m_OrderedInterruption: 1
m_CanTransitionToSelf: 1 m_CanTransitionToSelf: 1
--- !u!206 &6902226148018916867
BlendTree:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Moving
m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 13e7b0ee5b399f6469049de82d79df18, type: 2}
m_Threshold: 1
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: d21f099d8860b8541960bb36f8ec4eac, type: 2}
m_Threshold: 2
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 73786a7794bff2a4cab6595789479a9a, type: 2}
m_Threshold: 4
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 946abf85568070046b684c122ab8c4d3, type: 2}
m_Threshold: 8
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: State
m_Mirror: 0
m_BlendParameter: Direction
m_BlendParameterY: State
m_MinThreshold: 1
m_MaxThreshold: 8
m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0
m_BlendType: 0
--- !u!1107 &7006696717309671173 --- !u!1107 &7006696717309671173
AnimatorStateMachine: AnimatorStateMachine:
serializedVersion: 6 serializedVersion: 6
@@ -270,18 +296,14 @@ AnimatorStateMachine:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Base Layer m_Name: Base Layer
m_ChildStates: m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -5351155063058543854}
m_Position: {x: 380, y: 230, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -6692956035035760530} m_State: {fileID: -6692956035035760530}
m_Position: {x: 470, y: 100, z: 0} m_Position: {x: 420, y: 70, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 3691335081698814266} m_State: {fileID: -6650627269168583366}
m_Position: {x: 250, y: -10, z: 0} m_Position: {x: 441.02686, y: 229.12329, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: m_AnyStateTransitions: []
- {fileID: -9221672682127973356}
m_EntryTransitions: [] m_EntryTransitions: []
m_StateMachineTransitions: {} m_StateMachineTransitions: {}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
@@ -289,4 +311,4 @@ AnimatorStateMachine:
m_EntryPosition: {x: 70, y: 100, z: 0} m_EntryPosition: {x: 70, y: 100, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 3691335081698814266} m_DefaultState: {fileID: -6692956035035760530}

View File

@@ -0,0 +1,72 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PacManStoppedDown
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: -1291921845, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 40
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: -1291921845, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.025
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@@ -1,8 +1,8 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 184e93443ec1bb24fa4e1db8b51405da guid: bfa17ff437ea1c54cb39e122f0b21896
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000 mainObjectFileID: 7400000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View File

@@ -0,0 +1,72 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PacManStoppedLeft
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: -154195759, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 40
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: -154195759, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.025
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@@ -1,8 +1,8 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: c6e306d768eba5b469eea599abcf4800 guid: 8f4fe9b8c3a3716418e0d6666757e956
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000 mainObjectFileID: 7400000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View File

@@ -0,0 +1,72 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PacManStoppedRight
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: -1273145802, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 40
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: -1273145802, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.025
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@@ -1,8 +1,8 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 896816ace5640c644bd057ab48c3b9a1 guid: 014d5ceffb960844099b49fc63651f78
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000 mainObjectFileID: 7400000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View File

@@ -0,0 +1,72 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PacManStoppedUp
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: -388737089, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 40
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: -388737089, guid: 7c9882097c3869842a9cfc7730a9a2dc, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.025
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c3664638441f28a43ae34a14711f1bb8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -2804,7 +2804,6 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 2177688266556645545} - {fileID: 2177688266556645545}
- {fileID: 1943896580556949908}
- {fileID: 3712504672009017146} - {fileID: 3712504672009017146}
- {fileID: 3707824250034173467} - {fileID: 3707824250034173467}
- {fileID: 5304420742258014000} - {fileID: 5304420742258014000}
@@ -3045,110 +3044,6 @@ MonoBehaviour:
serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF
publicVariablesUnityEngineObjects: [] publicVariablesUnityEngineObjects: []
publicVariablesSerializationDataFormat: 0 publicVariablesSerializationDataFormat: 0
--- !u!1 &1469567527037123035
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3805127033795310874}
- component: {fileID: 5031360617562026835}
- component: {fileID: 5338398749469627165}
- component: {fileID: 4168259429290060702}
m_Layer: 0
m_Name: GhostCollider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3805127033795310874
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1469567527037123035}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 513719418908347298}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5031360617562026835
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1469567527037123035}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 197f2fb3a12aac94795943b0ee8d3320, type: 3}
m_Name:
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes: []
_udonSharpBackingUdonBehaviour: {fileID: 5338398749469627165}
--- !u!114 &5338398749469627165
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1469567527037123035}
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: 1
serializedProgramAsset: {fileID: 11400000, guid: c5c5f319202c800458920423915157d7, type: 2}
programSource: {fileID: 11400000, guid: 33ddebb883650354f868d672f01e54dd, type: 2}
serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF
publicVariablesUnityEngineObjects: []
publicVariablesSerializationDataFormat: 0
--- !u!136 &4168259429290060702
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1469567527037123035}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.2
m_Height: 2
m_Direction: 2
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &1474460525853194139 --- !u!1 &1474460525853194139
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -4128,7 +4023,7 @@ MonoBehaviour:
pacMan: {fileID: 7714172614521704433} pacMan: {fileID: 7714172614521704433}
ghostManager: {fileID: 86024623784576607} ghostManager: {fileID: 86024623784576607}
bonusFruit: {fileID: 9157969083631739240} bonusFruit: {fileID: 9157969083631739240}
pelletManager: {fileID: 5525660384197170489} collisionManager: {fileID: 5525660384197170489}
statusDisplay: {fileID: 2491098304099187056} statusDisplay: {fileID: 2491098304099187056}
attractScreen: {fileID: 775310085919228412} attractScreen: {fileID: 775310085919228412}
intermissionScreen: {fileID: 5421513610437161912} intermissionScreen: {fileID: 5421513610437161912}
@@ -7313,8 +7208,8 @@ Transform:
m_GameObject: {fileID: 3147892916020834424} m_GameObject: {fileID: 3147892916020834424}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -21.5, y: -0.5, z: 0} m_LocalPosition: {x: -16.5, y: -0.5, z: 0}
m_LocalScale: {x: 3, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 3555002988650332767} m_Father: {fileID: 3555002988650332767}
@@ -8025,112 +7920,6 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_renderer: {fileID: 6539332795346976013} m_renderer: {fileID: 6539332795346976013}
m_maskType: 0 m_maskType: 0
--- !u!1 &3434746169460523106
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1943896580556949908}
- component: {fileID: 8555249676190815205}
- component: {fileID: 8127898086093701786}
- component: {fileID: 6124172593973027271}
m_Layer: 22
m_Name: Grid Collision
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1943896580556949908
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3434746169460523106}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 16, y: 15.500008, z: 2.5}
m_LocalScale: {x: 28, y: 31.000015, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 9145873486794983750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!64 &8555249676190815205
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3434746169460523106}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 4194299
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 1474361029063556461, guid: 700689bd5d1823f47b577d684f2c3313, type: 3}
--- !u!33 &8127898086093701786
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3434746169460523106}
m_Mesh: {fileID: 1474361029063556461, guid: 700689bd5d1823f47b577d684f2c3313, type: 3}
--- !u!23 &6124172593973027271
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3434746169460523106}
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &3438059697432600989 --- !u!1 &3438059697432600989
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -9996,7 +9785,7 @@ MonoBehaviour:
_udonSharpBackingUdonBehaviour: {fileID: 1180286844452673728} _udonSharpBackingUdonBehaviour: {fileID: 1180286844452673728}
networkManager: {fileID: 0} networkManager: {fileID: 0}
root: {fileID: 6505452106475299050} root: {fileID: 6505452106475299050}
delay: 50 delay: 1
maxEventSendTries: 3 maxEventSendTries: 3
pingDelay: 15 pingDelay: 15
tickDelta: 0.016666668 tickDelta: 0.016666668
@@ -10224,8 +10013,8 @@ Transform:
m_GameObject: {fileID: 4219034801460140058} m_GameObject: {fileID: 4219034801460140058}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 21.5, y: -0.5, z: -0} m_LocalPosition: {x: 16.5, y: -0.5, z: 0}
m_LocalScale: {x: 3, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 3555002988650332767} m_Father: {fileID: 3555002988650332767}
@@ -11630,8 +11419,6 @@ GameObject:
- component: {fileID: 513719418908347298} - component: {fileID: 513719418908347298}
- component: {fileID: 7714172614521704433} - component: {fileID: 7714172614521704433}
- component: {fileID: 1727847739805735067} - component: {fileID: 1727847739805735067}
- component: {fileID: 9221443362494910120}
- component: {fileID: 4773642625458858929}
- component: {fileID: 4126301770395146711} - component: {fileID: 4126301770395146711}
- component: {fileID: 2694554446726062848} - component: {fileID: 2694554446726062848}
m_Layer: 0 m_Layer: 0
@@ -11653,8 +11440,7 @@ Transform:
m_LocalPosition: {x: 16, y: 7.500001, z: 0} m_LocalPosition: {x: 16, y: 7.500001, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children: []
- {fileID: 3805127033795310874}
m_Father: {fileID: 8246186970405181641} m_Father: {fileID: 8246186970405181641}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7714172614521704433 --- !u!114 &7714172614521704433
@@ -11936,54 +11722,6 @@ SpriteRenderer:
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 2 m_MaskInteraction: 2
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!65 &9221443362494910120
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4979601353925297299}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.5, y: 0.5, z: 2}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &4773642625458858929
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4979601353925297299}
serializedVersion: 4
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &4126301770395146711 --- !u!114 &4126301770395146711
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -12417,7 +12155,6 @@ GameObject:
- component: {fileID: 7199305853468815256} - component: {fileID: 7199305853468815256}
- component: {fileID: 9157969083631739240} - component: {fileID: 9157969083631739240}
- component: {fileID: 7365495875111851720} - component: {fileID: 7365495875111851720}
- component: {fileID: 3193872392568730759}
m_Layer: 0 m_Layer: 0
m_Name: Bonus Fruit m_Name: Bonus Fruit
m_TagString: Untagged m_TagString: Untagged
@@ -12562,27 +12299,6 @@ MonoBehaviour:
serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF
publicVariablesUnityEngineObjects: [] publicVariablesUnityEngineObjects: []
publicVariablesSerializationDataFormat: 0 publicVariablesSerializationDataFormat: 0
--- !u!65 &3193872392568730759
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5229491298805062834}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.5, y: 0.5, z: 0.5}
m_Center: {x: 0, y: -0.00000059604645, z: -0.00000011920929}
--- !u!1 &5382068025638518521 --- !u!1 &5382068025638518521
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -13570,8 +13286,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6046534300734189827} m_GameObject: {fileID: 6046534300734189827}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0.707061, y: -0, z: -0, w: 0.70715266}
m_LocalPosition: {x: 0, y: 6.63, z: -17.23} m_LocalPosition: {x: 0.91, y: 6.63, z: -17.23}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@@ -13582,7 +13298,7 @@ Transform:
- {fileID: 7739671690796916192} - {fileID: 7739671690796916192}
- {fileID: 8246186970405181641} - {fileID: 8246186970405181641}
m_Father: {fileID: 4412758497759775873} m_Father: {fileID: 4412758497759775873}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &6154585327471317047 --- !u!1 &6154585327471317047
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -15348,7 +15064,6 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 2177688266556645545} - component: {fileID: 2177688266556645545}
- component: {fileID: 8229914749694966936}
- component: {fileID: 4047720328164719605} - component: {fileID: 4047720328164719605}
- component: {fileID: 1165551057611019299} - component: {fileID: 1165551057611019299}
m_Layer: 0 m_Layer: 0
@@ -15373,28 +15088,6 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 9145873486794983750} m_Father: {fileID: 9145873486794983750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!64 &8229914749694966936
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7163777406449422992}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!212 &4047720328164719605 --- !u!212 &4047720328164719605
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -18030,7 +17723,7 @@ MonoBehaviour:
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0 m_IntArgument: 0
m_FloatArgument: 0 m_FloatArgument: 0
m_StringArgument: Intermission3 m_StringArgument: JumpToTimeSequenceIntermission3
m_BoolArgument: 0 m_BoolArgument: 0
m_CallState: 2 m_CallState: 2
--- !u!1 &8473082740403796940 --- !u!1 &8473082740403796940
@@ -18371,7 +18064,6 @@ Transform:
- {fileID: 4974322025078650459} - {fileID: 4974322025078650459}
- {fileID: 8663222629720968739} - {fileID: 8663222629720968739}
- {fileID: 5905242471040052083} - {fileID: 5905242471040052083}
- {fileID: 7572300588514824209}
- {fileID: 1307805930192074193} - {fileID: 1307805930192074193}
- {fileID: 8119785692059435336} - {fileID: 8119785692059435336}
- {fileID: 862107006485386518} - {fileID: 862107006485386518}
@@ -21609,7 +21301,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 27754be47f0109d4ebd0238a3abcab08, type: 2} objectReference: {fileID: 2100000, guid: 27754be47f0109d4ebd0238a3abcab08, type: 2}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
@@ -21649,7 +21341,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@@ -35645,7 +35337,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: d77dfda7d2b90ea4983b8659e2c6c0e9, type: 2} objectReference: {fileID: 2100000, guid: d77dfda7d2b90ea4983b8659e2c6c0e9, type: 2}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: _syncMethod propertyPath: _syncMethod
@@ -35681,7 +35373,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@@ -39153,7 +38845,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 60dca779cada8784ab66dba8be5a3187, type: 2} objectReference: {fileID: 2100000, guid: 60dca779cada8784ab66dba8be5a3187, type: 2}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: _syncMethod propertyPath: _syncMethod
@@ -39189,7 +38881,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@@ -45282,6 +44974,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Pellet value: Pellet
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7512162431685415002, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: pelletRenderer
value:
objectReference: {fileID: 6717290563504616900}
- target: {fileID: 7512162431685415002, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} - target: {fileID: 7512162431685415002, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: serializationData.Prefab propertyPath: serializationData.Prefab
value: value:
@@ -45300,6 +44996,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
m_PrefabInstance: {fileID: 5788101997426616030} m_PrefabInstance: {fileID: 5788101997426616030}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!212 &6717290563504616900 stripped
SpriteRenderer:
m_CorrespondingSourceObject: {fileID: 967117457436250906, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
m_PrefabInstance: {fileID: 5788101997426616030}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5818701876316508941 --- !u!1001 &5818701876316508941
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -56581,7 +56282,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: _syncMethod propertyPath: _syncMethod
@@ -56599,6 +56300,10 @@ PrefabInstance:
propertyPath: serializationData.Prefab propertyPath: serializationData.Prefab
value: value:
objectReference: {fileID: 4749455077414662322, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} objectReference: {fileID: 4749455077414662322, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
- target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7954158839068841090, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3} - target: {fileID: 7954158839068841090, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: gameStateManager propertyPath: gameStateManager
value: value:
@@ -59075,76 +58780,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3} m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
m_PrefabInstance: {fileID: 8822547946008480523} m_PrefabInstance: {fileID: 8822547946008480523}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1001 &8886851716888325062
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 3712504672009017146}
m_Modifications:
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalPosition.x
value: 23.5
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalPosition.y
value: 22.500011
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4099390335584803315, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: m_Name
value: Pellet (132)
objectReference: {fileID: 0}
- target: {fileID: 7512162431685415002, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 7512162431685415002, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
- target: {fileID: 9117212235706742114, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: _syncMethod
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
--- !u!4 &7572300588514824209 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
m_PrefabInstance: {fileID: 8886851716888325062}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8933059863330629529 --- !u!1001 &8933059863330629529
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@@ -34,7 +34,6 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 4191597391212281593} - {fileID: 4191597391212281593}
- {fileID: 4930314721506563510}
- {fileID: 3602007015285256100} - {fileID: 3602007015285256100}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -267,6 +266,7 @@ MonoBehaviour:
networkManager: {fileID: 0} networkManager: {fileID: 0}
ghostType: 3 ghostType: 3
startState: 0 startState: 0
targetIndicator: {fileID: 5838653651634851978}
--- !u!212 &4205939556154507887 --- !u!212 &4205939556154507887
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -365,61 +365,6 @@ MonoBehaviour:
serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF
publicVariablesUnityEngineObjects: [] publicVariablesUnityEngineObjects: []
publicVariablesSerializationDataFormat: 0 publicVariablesSerializationDataFormat: 0
--- !u!1 &1283232227864845355
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4930314721506563510}
- component: {fileID: 7503794487432367459}
m_Layer: 0
m_Name: PacManCollider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4930314721506563510
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1283232227864845355}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 140452431933686981}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &7503794487432367459
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1283232227864845355}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.25
m_Height: 2
m_Direction: 2
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &5838653651634851978 --- !u!1 &5838653651634851978
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -431,7 +376,6 @@ GameObject:
- component: {fileID: 4191597391212281593} - component: {fileID: 4191597391212281593}
- component: {fileID: 7008590632023811945} - component: {fileID: 7008590632023811945}
- component: {fileID: 1439451148072521473} - component: {fileID: 1439451148072521473}
- component: {fileID: 3313165921880363939}
m_Layer: 0 m_Layer: 0
m_Name: Target Indicator m_Name: Target Indicator
m_TagString: Untagged m_TagString: Untagged
@@ -504,27 +448,6 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &3313165921880363939
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5838653651634851978}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &6726417638088798178 --- !u!1001 &6726417638088798178
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@@ -9,7 +9,6 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 8163531541416620119} - component: {fileID: 8163531541416620119}
- component: {fileID: 1316532931576341977}
- component: {fileID: 7952758579179122936} - component: {fileID: 7952758579179122936}
- component: {fileID: 7532756116111475170} - component: {fileID: 7532756116111475170}
- component: {fileID: 4063084300691044555} - component: {fileID: 4063084300691044555}
@@ -36,27 +35,6 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &1316532931576341977
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6582247089451643248}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.5, y: 0.5, z: 0.5}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &7952758579179122936 --- !u!114 &7952758579179122936
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@@ -8,15 +8,16 @@ namespace Marro.PacManUdon
[RequireComponent(typeof(Renderer))] [RequireComponent(typeof(Renderer))]
public class BonusFruit : SyncedObject public class BonusFruit : SyncedObject
{ {
PacManFruitType fruitType; private PacManFruitType fruitType;
Animator animator; private Animator animator;
new Renderer renderer; private new Renderer renderer;
ScoreBonusDisplay scoreBonusDisplay; private ScoreBonusDisplay scoreBonusDisplay;
[UdonSynced] bool active; private bool active;
private int value;
private float activeCountdown; private float activeCountdown;
private int value;
private bool frozen; private bool frozen;
public void Initialize() public void Initialize()
@@ -30,15 +31,17 @@ namespace Marro.PacManUdon
public override void SyncedUpdate() public override void SyncedUpdate()
{ {
if (active && !frozen) if (!active || frozen)
{ {
return;
}
activeCountdown -= networkManager.SyncedDeltaTime; activeCountdown -= networkManager.SyncedDeltaTime;
if (activeCountdown <= 0) if (activeCountdown <= 0)
{ {
SetActive(false); SetActive(false);
} }
} }
}
public void Spawn() public void Spawn()
{ {
@@ -62,7 +65,6 @@ namespace Marro.PacManUdon
public void SetFruitType(PacManFruitType fruitType) public void SetFruitType(PacManFruitType fruitType)
{ {
this.fruitType = fruitType;
value = (int)fruitScoreValue[PacManConstants.FruitTypeToValue(fruitType)]; value = (int)fruitScoreValue[PacManConstants.FruitTypeToValue(fruitType)];
animator.SetFloat("FruitType", PacManConstants.FruitTypeToValue(fruitType)); animator.SetFloat("FruitType", PacManConstants.FruitTypeToValue(fruitType));
} }
@@ -80,31 +82,33 @@ namespace Marro.PacManUdon
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
data.Append(active, ref index);
if (!active)
{
return;
}
data.Append(activeCountdown, ref index);
data.Append(frozen, ref index);
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
SetActive(data.ReadBool(ref index));
if (!active)
{ {
return true; return true;
} }
public PacManFruitType FruitType activeCountdown = data.ReadFloat(ref index);
{ frozen = data.ReadBool(ref index);
set
{ return true;
SetFruitType(value);
}
get => fruitType;
} }
public bool Active public bool Active => active;
{
set
{
SetActive(value);
}
get => active;
}
private readonly DataDictionary fruitScoreValue = new DataDictionary() private readonly DataDictionary fruitScoreValue = new DataDictionary()
{ {

View File

@@ -10,7 +10,7 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: PelletManager m_Name: CollisionManager
m_EditorClassIdentifier: m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 9047ff9c4ab51104b8b0160387ad180b, type: 2} serializedUdonProgramAsset: {fileID: 11400000, guid: 9047ff9c4ab51104b8b0160387ad180b, type: 2}
udonAssembly: udonAssembly:
@@ -20,7 +20,7 @@ MonoBehaviour:
compiledVersion: 2 compiledVersion: 2
behaviourSyncMode: 0 behaviourSyncMode: 0
hasInteractEvent: 0 hasInteractEvent: 0
scriptID: 2205517818672966804 scriptID: 2892584015827264300
serializationData: serializationData:
SerializedFormat: 2 SerializedFormat: 2
SerializedBytes: SerializedBytes:
@@ -43,7 +43,7 @@ MonoBehaviour:
Data: Data:
- Name: - Name:
Entry: 12 Entry: 12
Data: 13 Data: 18
- Name: - Name:
Entry: 7 Entry: 7
Data: Data:
@@ -109,25 +109,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: <PelletCollectedCount>k__BackingField Data: gameManager
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: <PelletCollectedCount>k__BackingField Data: gameManager
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 7|System.RuntimeType, mscorlib Data: 7|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Int32, mscorlib Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 7 Data: 4
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -163,19 +163,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: gameManager Data: bonusFruit
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: gameManager Data: bonusFruit
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 10|System.RuntimeType, mscorlib Data: 10|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.GameManager, Assembly-CSharp Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -217,25 +217,31 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: bonusFruit Data: pellets
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: bonusFruit Data: pellets
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 13|System.RuntimeType, mscorlib Data: 13|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 7
Data: 4 Data: 14|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -250,7 +256,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -271,31 +277,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: pellets Data: powerPellets
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: pellets Data: powerPellets
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7
Data: 16|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7 Entry: 7
Data: 17|System.RuntimeType, mscorlib Data: 17|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule Data: UnityEngine.Animator[], UnityEngine.AnimationModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 17
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -331,25 +331,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: powerPellets Data: ghosts
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: powerPellets Data: ghosts
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 20|System.RuntimeType, mscorlib Data: 20|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: UnityEngine.Animator[], UnityEngine.AnimationModule Data: Marro.PacManUdon.Ghost[], Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 20 Data: 14
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -385,19 +385,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: powerPelletBlinkEnabled Data: collisionMap
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: powerPelletBlinkEnabled Data: collisionMap
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 23|System.RuntimeType, mscorlib Data: 23|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Boolean, mscorlib Data: System.Byte[], mscorlib
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -439,19 +439,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: powerPelletBlinkToggleInterval Data: pelletIndices
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: powerPelletBlinkToggleInterval Data: pelletIndices
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 26|System.RuntimeType, mscorlib Data: 26|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Single, mscorlib Data: System.Int32[], mscorlib
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -493,19 +493,127 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: powerPelletBlinkProgress Data: powerPelletBlinkEnabled
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletBlinkEnabled
- Name: <UserType>k__BackingField
Entry: 7
Data: 29|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 30|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: powerPelletBlinkToggleInterval
- Name: $v
Entry: 7
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletBlinkToggleInterval
- Name: <UserType>k__BackingField
Entry: 7
Data: 32|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 32
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: powerPelletBlinkProgress
- Name: $v
Entry: 7
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: powerPelletBlinkProgress Data: powerPelletBlinkProgress
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 26 Data: 32
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 26 Data: 32
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -520,7 +628,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -544,16 +652,16 @@ MonoBehaviour:
Data: powerPelletBlinkCurrentlyVisible Data: powerPelletBlinkCurrentlyVisible
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: powerPelletBlinkCurrentlyVisible Data: powerPelletBlinkCurrentlyVisible
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 23 Data: 29
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 23 Data: 29
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -568,109 +676,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 31|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
- 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: syncedPelletsCollected
- Name: $v
Entry: 7
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: syncedPelletsCollected
- Name: <UserType>k__BackingField
Entry: 7
Data: 33|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Byte[], mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 34|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: collisionMap
- Name: $v
Entry: 7
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: collisionMap
- Name: <UserType>k__BackingField
Entry: 9
Data: 33
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -694,16 +700,16 @@ MonoBehaviour:
Data: pelletMap Data: pelletMap
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: pelletMap Data: pelletMap
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 33 Data: 23
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 33 Data: 23
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -718,7 +724,259 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 39|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: syncedPelletsCollected
- Name: $v
Entry: 7
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: syncedPelletsCollected
- Name: <UserType>k__BackingField
Entry: 9
Data: 23
- Name: <SystemType>k__BackingField
Entry: 9
Data: 23
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 41|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: pelletCollectedCount
- Name: $v
Entry: 7
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pelletCollectedCount
- Name: <UserType>k__BackingField
Entry: 7
Data: 43|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Byte, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 43
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: ghostPositions
- Name: $v
Entry: 7
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ghostPositions
- Name: <UserType>k__BackingField
Entry: 9
Data: 26
- Name: <SystemType>k__BackingField
Entry: 9
Data: 26
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: pacManPosition
- Name: $v
Entry: 7
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pacManPosition
- Name: <UserType>k__BackingField
Entry: 7
Data: 48|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 48
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: frozen
- Name: $v
Entry: 7
Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: frozen
- Name: <UserType>k__BackingField
Entry: 9
Data: 29
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0

View File

@@ -3,55 +3,225 @@ using UnityEngine;
namespace Marro.PacManUdon namespace Marro.PacManUdon
{ {
enum PelletType enum EatResult
{ {
None, None,
Pellet, Pellet,
PowerPellet PowerPellet
} }
public class PelletManager : SyncedObject
public class CollisionManager : SyncedObject
{ {
public int PelletCount => pellets.Length; public int PelletCount => pellets.Length;
public int PelletCollectedCount { get; private set; }
private GameManager gameManager; private GameManager gameManager;
private BonusFruit bonusFruit; private BonusFruit bonusFruit;
private Pellet[] pellets;
private Animator[] powerPellets;
private Ghost[] ghosts;
Pellet[] pellets; private byte[] collisionMap;
Animator[] powerPellets; private int[] pelletIndices;
bool powerPelletBlinkEnabled; private const int mazeWidth = 32;
float powerPelletBlinkToggleInterval; private const int mazeHeight = 32;
float powerPelletBlinkProgress;
bool powerPelletBlinkCurrentlyVisible;
byte[] syncedPelletsCollected; private bool powerPelletBlinkEnabled;
private float powerPelletBlinkToggleInterval;
private float powerPelletBlinkProgress;
private bool powerPelletBlinkCurrentlyVisible;
byte[] collisionMap; private byte[] pelletMap;
byte[] pelletMap; private byte[] syncedPelletsCollected;
private byte pelletCollectedCount;
const int mazeWidth = 32; private int[] ghostPositions = new int[4];
const int mazeHeight = 32; private int pacManPosition;
public void Initialize(GameManager gameManager, BonusFruit bonusFruit) private bool frozen;
public void Initialize(GameManager gameManager, BonusFruit bonusFruit, Ghost[] ghosts)
{ {
this.gameManager = gameManager; this.gameManager = gameManager;
this.bonusFruit = bonusFruit; this.bonusFruit = bonusFruit;
this.ghosts = ghosts;
gameObject.SetActive(true); gameObject.SetActive(true);
pellets = GetComponentsInChildren<Pellet>(includeInactive: true); pellets = GetComponentsInChildren<Pellet>(includeInactive: true);
powerPellets = GetComponentsInChildren<Animator>(true); powerPellets = GetComponentsInChildren<Animator>(true);
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval(); powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
SetPowerPelletsBlink(false);
collisionMap = PacManConstants.GetMazeCollisionInfo(); collisionMap = PacManConstants.GetMazeCollisionInfo();
pelletIndices = PacManConstants.GetMazePelletIndices();
Reset();
}
public void Reset()
{
SetPowerPelletsBlink(false);
RestoreAllPellets(); RestoreAllPellets();
SubscribeToEvent(NetworkEventType.SyncPellets);
} }
internal void SetFrozen(bool frozen)
{
this.frozen = frozen;
if (!frozen)
{
SetPowerPelletsBlink(true);
}
}
#region Collision
public bool IsWallUpcoming(Vector2 position, Vector2 directionVector)
{
var index = GetTilemapIndex(position + directionVector);
var tile = collisionMap[index];
var result = (tile & (int)PacManCollisionInfoType.Wall) != 0;
//Debug.Log($"IsWallUpcoming {position}, {directionVector}. index {index}, tile {tile}, result {result}, collisionMap.Length {collisionMap.Length}");
return result;
}
public bool GhostMoveToTile(Vector2 position, int ghostIndex)
{
var tile = GetTilemapIndex(position);
ghostPositions[ghostIndex] = tile;
if (!frozen && tile == pacManPosition)
{
//Debug.Log("Ghost hit PacMan!");
ghosts[ghostIndex].HitPacMan();
}
return (collisionMap[tile] & (int)PacManCollisionInfoType.Tunnel) != 0;
}
internal EatResult PacManMoveToTile(Vector2 position, Vector2 nextPosition)
{
var tilemapIndex = GetTilemapIndex(nextPosition);
var tile = pelletMap[tilemapIndex];
pacManPosition = tilemapIndex;
if (!frozen)
{
PacManTryEatGhost();
}
TryCollectFruit(tile, position);
return TryCollectPellet(tile, tilemapIndex);
}
internal void PacManTryEatGhost()
{
for (int i = 0; i < ghosts.Length; i++)
{
if (ghostPositions[i] != pacManPosition)
{
continue;
}
if (ghosts[i].HitPacMan()) // Only one collision may happen at a time
{
//Debug.Log("PacMan hit ghost!");
return;
}
}
}
private void TryCollectFruit(int tile, Vector2 position)
{
if (tile != (int)PacManConsumableType.FruitLeft && tile != (int)PacManConsumableType.FruitRight
|| !bonusFruit.Active)
{
return;
}
var previousTile = pelletMap[GetTilemapIndex(position)];
//Debug.Log($"On fruit tile {tile}, previous tile was {previousTile}. Position {position}, nextPosition {nextPosition}");
if (tile == (int)PacManConsumableType.FruitLeft && previousTile == (int)PacManConsumableType.FruitRight
|| tile == (int)PacManConsumableType.FruitRight && previousTile == (int)PacManConsumableType.FruitLeft)
{
//Debug.Log("Collecting fruit");
gameManager.GotFruit();
}
}
public int GetAvailableDirections(Vector2 position)
{
var directions = collisionMap[GetTilemapIndex(position)];
return directions;
}
internal static int GetTilemapIndex(Vector2 position)
{
// (int)position.x %% mazeWidth + (int)position.y %% mazeHeight * mazeWidth, where %% is an absolute modulo
// Absoliute modulo in this case is implemented by just adding the divisor, works good enough and is performant.
var index = ((int)position.x + mazeWidth) % mazeWidth + ((int)position.y + mazeHeight) % mazeHeight * mazeWidth;
return index;
}
#endregion
#region Pellet collecting
private EatResult TryCollectPellet(int tile, int tilemapIndex)
{
if (tile < 0 || tile >= pellets.Length)
{
return EatResult.None;
}
pelletMap[tilemapIndex] = (byte)PacManConsumableType.None;
var pellet = pellets[tile];
pellet.gameObject.SetActive(false);
var index = pellet.transform.GetSiblingIndex();
syncedPelletsCollected[index / 8] |= (byte)(1 << index % 8);
pelletCollectedCount++;
var pelletType = pellet.isPowerPellet ? EatResult.PowerPellet : EatResult.Pellet;
gameManager.GotPellet(pellet, pellet.isPowerPellet, pelletCollectedCount, PelletCount - pelletCollectedCount);
return pelletType;
}
public int RestoreAllPellets()
{
foreach (var pellet in pellets)
{
pellet.gameObject.SetActive(true);
}
syncedPelletsCollected = new byte[pellets.Length/8 + 1];
pelletCollectedCount = 0;
pelletMap = PacManConstants.GetMazePelletMap();
return PelletCount;
}
private void SetPelletsCollectedFromSync()
{
for (byte i = 0; i < pellets.Length; i++)
{
var active = (syncedPelletsCollected[i/8] & (byte)(1 << i%8)) == 0;
pellets[i].gameObject.SetActive(active);
pelletMap[pelletIndices[i]] = active ? i : (byte)PacManConsumableType.None;
}
}
#endregion
#region Power pellet blink #region Power pellet blink
public override void SyncedUpdate() public override void SyncedUpdate()
{ {
@@ -95,146 +265,23 @@ namespace Marro.PacManUdon
} }
#endregion #endregion
#region Collision
public bool IsWallUpcoming(Vector2 position, Vector2 directionVector)
{
var index = GetTilemapIndex(position + directionVector);
var tile = collisionMap[index];
var result = (tile & (int)PacManCollisionInfoType.Wall) != 0;
Debug.Log($"IsWallUpcoming {position}, {directionVector}. index {index}, tile {tile}, result {result}, collisionMap.Length {collisionMap.Length}");
return result;
}
public bool IsInTunnel(Vector2 position)
{
var result = (collisionMap[GetTilemapIndex(position)] & (int)PacManCollisionInfoType.Tunnel) != 0;
if (result)
{
Debug.Log($"In tunnel at {position}");
}
return result;
}
internal PelletType EatAtTile(Vector2 position, Vector2 nextPosition)
{
var tilemapIndex = GetTilemapIndex(nextPosition);
var tile = pelletMap[tilemapIndex];
TryCollectFruit(tile, position, nextPosition);
return TryCollectPellet(tile, tilemapIndex);
}
private void TryCollectFruit(int tile, Vector2 position, Vector2 nextPosition)
{
if (tile != (int)PacManConsumableType.FruitLeft && tile != (int)PacManConsumableType.FruitRight
|| !bonusFruit.Active)
{
return;
}
var previousTile = pelletMap[GetTilemapIndex(position)];
Debug.Log($"On fruit tile {tile}, previous tile was {previousTile}. Position {position}, nextPosition {nextPosition}");
if (tile == (int)PacManConsumableType.FruitLeft && previousTile == (int)PacManConsumableType.FruitRight
|| tile == (int)PacManConsumableType.FruitRight && previousTile == (int)PacManConsumableType.FruitLeft)
{
Debug.Log("Collecting fruit");
gameManager.GotFruit();
}
}
public int GetAvailableDirections(Vector2 position)
{
var directions = collisionMap[GetTilemapIndex(position)];
return directions;
}
internal static int GetTilemapIndex(Vector2 position)
{
// (int)position.x %% mazeWidth + (int)position.y %% mazeHeight * mazeWidth, where %% is an absolute modulo
// Absoliute modulo in this case is implemented by just adding the divisor, works good enough and is performant.
var index = ((int)position.x + mazeWidth) % mazeWidth + ((int)position.y + mazeHeight) % mazeHeight * mazeWidth;
return index;
}
#endregion
#region Pellet collecting
private PelletType TryCollectPellet(int tile, int tilemapIndex)
{
if (tile < 0 || tile >= pellets.Length)
{
return PelletType.None;
}
pelletMap[tilemapIndex] = (byte)PacManConsumableType.None;
var pellet = pellets[tile];
pellet.gameObject.SetActive(false);
var index = pellet.transform.GetSiblingIndex();
syncedPelletsCollected[index / 8] |= (byte)(1 << index % 8);
PelletCollectedCount++;
var pelletType = pellet.isPowerPellet ? PelletType.PowerPellet : PelletType.Pellet;
gameManager.GotPellet(pellet, pelletType, PelletCollectedCount, PelletCount - PelletCollectedCount);
return pelletType;
}
public int RestoreAllPellets()
{
foreach (var pellet in pellets)
{
pellet.gameObject.SetActive(true);
}
syncedPelletsCollected = new byte[pellets.Length/8 + 1];
PelletCollectedCount = 0;
pelletMap = PacManConstants.GetMazePelletMap();
return PelletCount;
}
private void SetPelletsCollectedFromSync()
{
for (int i = 0; i < pellets.Length; i++)
{
var active = (syncedPelletsCollected[i/8] & (byte)(1 << i%8)) == 0;
pellets[i].gameObject.SetActive(active);
}
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.SyncPellets) data.Append(pelletCollectedCount, ref index);
{
return;
}
data.Append((byte)PelletCollectedCount, ref index);
data.Append(syncedPelletsCollected, ref index); data.Append(syncedPelletsCollected, ref index);
data.Append(frozen, ref index);
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.SyncPellets) pelletCollectedCount = data.ReadByte(ref index);
{
return true;
}
PelletCollectedCount = data.ReadByte(ref index);
Array.Copy(data, index, syncedPelletsCollected, 0, syncedPelletsCollected.Length); Array.Copy(data, index, syncedPelletsCollected, 0, syncedPelletsCollected.Length);
index += syncedPelletsCollected.Length; index += syncedPelletsCollected.Length;
SetPelletsCollectedFromSync(); SetPelletsCollectedFromSync();
frozen = data.ReadBool(ref index);
return true; return true;
} }
#endregion
} }
} }

View File

@@ -354,8 +354,8 @@ MonoBehaviour:
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name: - Name:
Entry: 3 Entry: 6
Data: 1 Data:
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -367,13 +367,7 @@ MonoBehaviour:
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 0
- Name:
Entry: 7
Data: 22|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name: - Name:
Entry: 13 Entry: 13
Data: Data:
@@ -391,19 +385,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: value Data: activeCountdown
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: value Data: activeCountdown
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 8 Data: 23|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 8 Data: 23
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -439,25 +439,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: activeCountdown Data: value
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: activeCountdown Data: value
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 26|System.RuntimeType, mscorlib Data: 8
- Name:
Entry: 1
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 26 Data: 8
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -472,7 +466,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -496,7 +490,7 @@ MonoBehaviour:
Data: frozen Data: frozen
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: frozen Data: frozen
@@ -520,7 +514,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -544,13 +538,13 @@ MonoBehaviour:
Data: fruitScoreValue Data: fruitScoreValue
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: fruitScoreValue Data: fruitScoreValue
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 31|System.RuntimeType, mscorlib Data: 30|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3 Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
@@ -559,7 +553,7 @@ MonoBehaviour:
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 31 Data: 30
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -574,7 +568,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0

View File

@@ -43,7 +43,7 @@ MonoBehaviour:
Data: Data:
- Name: - Name:
Entry: 12 Entry: 12
Data: 34 Data: 33
- Name: - Name:
Entry: 7 Entry: 7
Data: Data:
@@ -730,19 +730,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: pelletManager Data: collisionManager
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: pelletManager Data: collisionManager
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 44|System.RuntimeType, mscorlib Data: 44|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.PelletManager, Assembly-CSharp Data: Marro.PacManUdon.CollisionManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -1078,25 +1078,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: demo Data: soundManager
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: demo Data: soundManager
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 66|System.RuntimeType, mscorlib Data: 66|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule Data: SoundManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 66 Data: 4
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1136,72 +1136,12 @@ MonoBehaviour:
- Name: - Name:
Entry: 7 Entry: 7
Data: Data:
- Name: $k
Entry: 1
Data: soundManager
- Name: $v
Entry: 7
Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: soundManager
- Name: <UserType>k__BackingField
Entry: 7
Data: 70|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: SoundManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: 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 - Name: $k
Entry: 1 Entry: 1
Data: networkManagerSetup Data: networkManagerSetup
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: networkManagerSetup Data: networkManagerSetup
@@ -1225,13 +1165,13 @@ MonoBehaviour:
Data: true Data: true
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 70|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 1
- Name: - Name:
Entry: 7 Entry: 7
Data: 75|UnityEngine.SerializeField, UnityEngine.CoreModule Data: 71|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -1255,7 +1195,7 @@ MonoBehaviour:
Data: recorder Data: recorder
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: recorder Data: recorder
@@ -1279,10 +1219,73 @@ MonoBehaviour:
Data: true Data: true
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 1
- Name:
Entry: 7
Data: 74|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: startingExtraLives
- Name: $v
Entry: 7
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: startingExtraLives
- Name: <UserType>k__BackingField
Entry: 9
Data: 15
- Name: <SystemType>k__BackingField
Entry: 9
Data: 15
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 76|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data: 77|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
- Name: header
Entry: 1
Data: Game settings
- Name:
Entry: 8
Data:
- Name: - Name:
Entry: 7 Entry: 7
Data: 78|UnityEngine.SerializeField, UnityEngine.CoreModule Data: 78|UnityEngine.SerializeField, UnityEngine.CoreModule
@@ -1306,13 +1309,13 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: startingExtraLives Data: scoreToExtraLife
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: startingExtraLives Data: scoreToExtraLife
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 15 Data: 15
@@ -1334,75 +1337,12 @@ MonoBehaviour:
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 80|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 80|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data: 81|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
- Name: header
Entry: 1
Data: Game settings
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 82|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: scoreToExtraLife
- Name: $v
Entry: 7
Data: 83|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: scoreToExtraLife
- Name: <UserType>k__BackingField
Entry: 9
Data: 15
- Name: <SystemType>k__BackingField
Entry: 9
Data: 15
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 84|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 1
- Name: - Name:
Entry: 7 Entry: 7
Data: 85|UnityEngine.SerializeField, UnityEngine.CoreModule Data: 81|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -1426,13 +1366,13 @@ MonoBehaviour:
Data: maze Data: maze
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 82|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: maze Data: maze
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 87|System.RuntimeType, mscorlib Data: 83|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.Maze, Assembly-CSharp Data: Marro.PacManUdon.Maze, Assembly-CSharp
@@ -1456,7 +1396,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 88|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 84|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1480,13 +1420,13 @@ MonoBehaviour:
Data: intermission2Pole Data: intermission2Pole
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 85|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: intermission2Pole Data: intermission2Pole
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 90|System.RuntimeType, mscorlib Data: 86|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.Intermission2Pole, Assembly-CSharp Data: Marro.PacManUdon.Intermission2Pole, Assembly-CSharp
@@ -1510,7 +1450,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 91|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 87|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1534,16 +1474,76 @@ MonoBehaviour:
Data: mazeSpriteAnimator Data: mazeSpriteAnimator
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 92|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 88|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: mazeSpriteAnimator Data: mazeSpriteAnimator
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 66 Data: 89|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 66 Data: 89
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 90|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: 91|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: attractScreenElements
- Name: <UserType>k__BackingField
Entry: 7
Data: 92|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 92
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1579,25 +1579,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: attractScreenElements Data: intermissionScreenElements
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 94|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 94|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: attractScreenElements Data: intermissionScreenElements
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 95|System.RuntimeType, mscorlib Data: 92
- Name:
Entry: 1
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 95 Data: 92
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1612,7 +1606,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 96|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 95|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1633,19 +1627,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: intermissionScreenElements Data: gameState
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 97|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 96|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: intermissionScreenElements Data: gameState
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 95 Data: 97|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.PacManGameState, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 95 Data: 15
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1681,65 +1681,10 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: gameState Data: score
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: gameState
- Name: <UserType>k__BackingField
Entry: 7
Data: 100|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.PacManGameState, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 15
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 101|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: 102|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: score Data: score
@@ -1763,7 +1708,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 103|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], Data: 100|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib mscorlib
- Name: - Name:
Entry: 12 Entry: 12
@@ -1788,7 +1733,7 @@ MonoBehaviour:
Data: level Data: level
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 104|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 101|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: level Data: level
@@ -1812,7 +1757,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 105|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], Data: 102|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib mscorlib
- Name: - Name:
Entry: 12 Entry: 12
@@ -1837,7 +1782,7 @@ MonoBehaviour:
Data: highScore Data: highScore
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 106|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 103|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: highScore Data: highScore
@@ -1861,7 +1806,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 107|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], Data: 104|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib mscorlib
- Name: - Name:
Entry: 12 Entry: 12
@@ -1886,7 +1831,7 @@ MonoBehaviour:
Data: extraLives Data: extraLives
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 108|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 105|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: extraLives Data: extraLives
@@ -1910,7 +1855,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 109|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], Data: 106|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib mscorlib
- Name: - Name:
Entry: 12 Entry: 12

View File

@@ -10,13 +10,12 @@ namespace Marro.PacManUdon
[SerializeField] private PacMan pacMan; [SerializeField] private PacMan pacMan;
[SerializeField] private GhostManager ghostManager; [SerializeField] private GhostManager ghostManager;
[SerializeField] private BonusFruit bonusFruit; [SerializeField] private BonusFruit bonusFruit;
[SerializeField] private PelletManager pelletManager; [SerializeField] private CollisionManager collisionManager;
[SerializeField] private StatusDisplay statusDisplay; [SerializeField] private StatusDisplay statusDisplay;
[SerializeField] private PelletManager attractScreen; [SerializeField] private CollisionManager attractScreen;
[SerializeField] private GameObject intermissionScreen; [SerializeField] private GameObject intermissionScreen;
[SerializeField] private GameObject pressStartButtonScreen; [SerializeField] private GameObject pressStartButtonScreen;
[SerializeField] private PlayerInput playerInput; [SerializeField] private PlayerInput playerInput;
[SerializeField] private Animator demo;
[SerializeField] private SoundManager soundManager; [SerializeField] private SoundManager soundManager;
[SerializeField] private NetworkManager networkManagerSetup; [SerializeField] private NetworkManager networkManagerSetup;
@@ -58,17 +57,17 @@ namespace Marro.PacManUdon
intermission2Pole = intermissionScreenElements[4].GetComponent<Intermission2Pole>(); intermission2Pole = intermissionScreenElements[4].GetComponent<Intermission2Pole>();
networkManager.Initialize(); networkManager.Initialize();
ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, pelletManager, this); ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, collisionManager, this);
pacMan.Initialize(playerInput, maze.pacManStart, this, pelletManager); pacMan.Initialize(playerInput, maze.pacManStart, this, collisionManager);
bonusFruit.Initialize(); bonusFruit.Initialize();
pelletManager.Initialize(this, bonusFruit); collisionManager.Initialize(this, bonusFruit, ghostManager.Ghosts);
statusDisplay.Initialize(); statusDisplay.Initialize();
playerInput.Initialize(this); playerInput.Initialize(this);
soundManager.Initialize(); soundManager.Initialize();
intermission2Pole.Initialize(this, ghostManager.Ghosts[0]); intermission2Pole.Initialize(this, ghostManager.Ghosts[0]);
SubscribeToEvent(NetworkEventType.StartGameButtonPressed); SubscribeToEvent(NetworkEventType.StartGameButtonPressed);
SubscribeToEvent(NetworkEventType.TimeSequenceSync); SubscribeToEvent(NetworkEventType.FullSync);
HideEverything(); HideEverything();
@@ -107,7 +106,7 @@ namespace Marro.PacManUdon
Debug.Log($"{gameObject} Start Game Button was pressed!"); Debug.Log($"{gameObject} Start Game Button was pressed!");
if (networkManager.IsOwner) if (networkManager.IsOwner)
{ {
networkManager.SendEventNow(NetworkEventType.StartGameButtonPressed); networkManager.SendEventSoon(NetworkEventType.StartGameButtonPressed, false);
} }
StartTimeSequence(PacManTimeSequence.StartNewGame); StartTimeSequence(PacManTimeSequence.StartNewGame);
} }
@@ -132,28 +131,18 @@ namespace Marro.PacManUdon
SetLevel(1); SetLevel(1);
} }
private void InitializeLevel()
{
//Debug.Log($"{gameObject} New level started!");
pelletManager.RestoreAllPellets();
ghostManager.NewLevel();
mazeSpriteAnimator.SetBool("Blinking", false);
}
private void RestartLevel(bool afterLifeLost = false) private void RestartLevel(bool afterLifeLost = false)
{ {
//Debug.Log($"{gameObject} (Re)started level!"); //Debug.Log($"{gameObject} (Re)started level!");
// SetInGameComponentVisibility(true); mazeSpriteAnimator.SetBool("Blinking", false);
ghostManager.RestartLevel(afterLifeLost); ghostManager.RestartLevel(afterLifeLost);
pacMan.Reset(); pacMan.Reset();
bonusFruit.Despawn(); bonusFruit.Despawn();
soundManager.Reset(); soundManager.Reset();
pelletManager.SetPowerPelletsBlink(false); collisionManager.Reset();
statusDisplay.Reset();
} }
private void PrepareForCutscene() private void PrepareForCutscene()
@@ -163,9 +152,9 @@ namespace Marro.PacManUdon
SetFrozen(true); SetFrozen(true);
} }
internal void GotPellet(Pellet pellet, PelletType pelletType, int pelletsCollectedCount, int pelletsRemainingCount) internal void GotPellet(Pellet pellet, bool isPowerPellet, int pelletsCollectedCount, int pelletsRemainingCount)
{ {
AddScore(pelletType == PelletType.PowerPellet ? 50 : 10); AddScore(isPowerPellet ? 50 : 10);
ghostManager.PelletConsumed(pelletsRemainingCount); ghostManager.PelletConsumed(pelletsRemainingCount);
@@ -178,7 +167,7 @@ namespace Marro.PacManUdon
return; return;
} }
if (pelletType == PelletType.PowerPellet) if (isPowerPellet)
{ {
if (gameState == PacManGameState.AttractMode) if (gameState == PacManGameState.AttractMode)
{ {
@@ -229,7 +218,6 @@ namespace Marro.PacManUdon
AddScore(scoreBonus); AddScore(scoreBonus);
StartTimeSequence(PacManTimeSequence.GhostCaught); StartTimeSequence(PacManTimeSequence.GhostCaught);
pacMan.HideUntilUnfrozen();
} }
public void PacManCaught() public void PacManCaught()
@@ -275,12 +263,11 @@ namespace Marro.PacManUdon
statusDisplay.SetLevelDisplayVisible(false); statusDisplay.SetLevelDisplayVisible(false);
statusDisplay.SetPlayer1TextVisible(false); statusDisplay.SetPlayer1TextVisible(false);
statusDisplay.SetReadyTextVisible(false); statusDisplay.SetReadyTextVisible(false);
demo.gameObject.SetActive(false);
} }
void SetPelletsActive(bool active) void SetPelletsActive(bool active)
{ {
pelletManager.gameObject.SetActive(active); collisionManager.gameObject.SetActive(active);
} }
void SetMazeVisible(bool visible) void SetMazeVisible(bool visible)
@@ -385,23 +372,49 @@ namespace Marro.PacManUdon
soundManager.PlayExtraLifeSound(); soundManager.PlayExtraLifeSound();
} }
private void SetupInGameState()
{
gameState = PacManGameState.InGame;
attractScreen.gameObject.SetActive(false);
SetPelletsActive(true);
SetMazeVisible(true);
SetGhostsActive(true);
SetPacManActive(true);
statusDisplay.SetExtraLivesDisplayVisible(true);
statusDisplay.SetLevelDisplayVisible(true);
statusDisplay.SetLabel1UPTextBlinking(true);
soundManager.SuppressSound(false);
soundManager.StartGhostSound();
SetFrozen(false);
}
public void SetFrozen(bool frozen, bool ghostIgnoreIfCaught = false, bool ghostKeepAnimating = false) public void SetFrozen(bool frozen, bool ghostIgnoreIfCaught = false, bool ghostKeepAnimating = false)
{ {
// Debug.Log($"{gameObject} Set Frozen: {frozen}"); // Debug.Log($"{gameObject} Set Frozen: {frozen}");
pacMan.SetFrozen(frozen); pacMan.SetFrozen(frozen);
bonusFruit.SetFrozen(frozen); bonusFruit.SetFrozen(frozen);
ghostManager.SetFrozen(frozen, ignoreIfCaught: ghostIgnoreIfCaught); ghostManager.SetFrozen(frozen, ignoreIfCaught: ghostIgnoreIfCaught);
collisionManager.SetFrozen(frozen);
if (!frozen)
{
pelletManager.SetPowerPelletsBlink(true);
}
} }
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType == NetworkEventType.TimeSequenceSync) if (eventType != NetworkEventType.FullSync)
{ {
return;
}
data.Append(gameState == PacManGameState.InGame, ref index);
data.AppendAsByte(level, ref index);
data.Append(score, ref index);
data.AppendAsByte(extraLives, ref index);
data.Append(currentlyInTimeSequence, ref index); data.Append(currentlyInTimeSequence, ref index);
if (currentlyInTimeSequence) if (currentlyInTimeSequence)
@@ -409,12 +422,16 @@ namespace Marro.PacManUdon
data.AppendAsByte((int)currentTimeSequence, ref index); data.AppendAsByte((int)currentTimeSequence, ref index);
data.Append(timeSequenceSecondsPassed, ref index); data.Append(timeSequenceSecondsPassed, ref index);
} }
}
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)gameState) }; bonusFruit.CollectSyncedData(data, ref index, eventType);
//data[offset++] = BitConverter.GetBytes(currentlyInTimeSequence);
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)currentTimeSequence) }; collisionManager.CollectSyncedData(data, ref index, eventType);
//data[offset++] = BitConverter.GetBytes(timeSequenceSecondsPassed);
ghostManager.CollectSyncedData(data, ref index, eventType);
pacMan.CollectSyncedData(data, ref index, eventType);
soundManager.CollectSyncedData(data, ref index, eventType);
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
@@ -422,30 +439,48 @@ namespace Marro.PacManUdon
if (eventType == NetworkEventType.StartGameButtonPressed) if (eventType == NetworkEventType.StartGameButtonPressed)
{ {
StartGameButtonPressed(); StartGameButtonPressed();
return true;
} }
if (eventType == NetworkEventType.TimeSequenceSync) if (eventType != NetworkEventType.FullSync)
{ {
var currentlyInTimeSequence = data.ReadBool(ref index); return true;
if (currentlyInTimeSequence) }
// If we're currently in-game, we'll need to make sure the state is setup correctly
var remoteCurrentlyInGame = data.ReadBool(ref index);
if (remoteCurrentlyInGame)
{
currentlyInTimeSequence = false; // Kill the current time sequence, otherwise it might interfere
// No need to run it to completion since we're overriding all state
SetupInGameState();
}
SetLevel(data.ReadByte(ref index));
SetScore(data.ReadInt(ref index));
SetExtraLives(data.ReadByte(ref index));
// Sync up with the remote's time sequence
var remoteCurrentlyInTimeSequence = data.ReadBool(ref index);
if (remoteCurrentlyInTimeSequence)
{ {
var currentTimeSequence = (PacManTimeSequence)data.ReadByte(ref index); var currentTimeSequence = (PacManTimeSequence)data.ReadByte(ref index);
var timeSequenceSecondsPassed = data.ReadFloat(ref index); var timeSequenceSecondsPassed = data.ReadFloat(ref index);
TimeSequenceSyncWithRemote(currentTimeSequence, timeSequenceSecondsPassed); TimeSequenceSyncWithRemote(currentTimeSequence, timeSequenceSecondsPassed);
} }
else
{
TimeSequenceTryEndCurrent();
}
}
//SetGameState((PacManGameState)data[offset++]); // Note that we don't have any logic for if the remote is not in-game and not in a time sequence.
// Such a state should be impossible.
//var currentlyInTimeSequence = BitConverter.ToBoolean(data, offset++); bonusFruit.WriteSyncedData(data, ref index, eventType);
//var currentTimeSequence = (PacManTimeSequence)data[offset++];
//var timeSequenceSecondsPassed = BitConverter.ToSingle(data, offset); collisionManager.WriteSyncedData(data, ref index, eventType);
//offset += 4;
//TimeSequenceSyncWithRemote(currentlyInTimeSequence, currentTimeSequence, timeSequenceSecondsPassed); ghostManager.WriteSyncedData(data, ref index, eventType);
pacMan.WriteSyncedData(data, ref index, eventType);
soundManager.WriteSyncedData(data, ref index, eventType);
return true; return true;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,15 @@ namespace Marro.PacManUdon
Special, Special,
} }
enum PacManGhostAnimatorState
{
Normal,
Caught,
Scared,
ScaredWhite,
Special
}
public enum PacManGhostState public enum PacManGhostState
{ {
Normal, Normal,
@@ -22,7 +31,8 @@ namespace Marro.PacManUdon
Returning, Returning,
Entering, Entering,
Home, Home,
Exiting Exiting,
WaitingForStart,
} }
public enum PacManGhostStartState public enum PacManGhostStartState
@@ -38,19 +48,18 @@ namespace Marro.PacManUdon
{ {
[SerializeField] private PacManGhostType ghostType; [SerializeField] private PacManGhostType ghostType;
[SerializeField] private PacManGhostStartState startState; [SerializeField] private PacManGhostStartState startState;
[SerializeField] private GameObject targetIndicator;
// External references // External references
private GhostManager ghostManager; private GhostManager ghostManager;
private PelletManager pelletManager; private CollisionManager collisionManager;
private Animator animator; private Animator animator;
private new Renderer renderer; private new Renderer renderer;
private PacMan pacMan; private PacMan pacMan;
private Ghost blinky; private Ghost blinky;
private ScoreBonusDisplay scoreBonusDisplay; private ScoreBonusDisplay scoreBonusDisplay;
private Vector3 startPosition; private Vector2 startPosition;
private Quaternion startRotation;
private Vector2 homePosition; private Vector2 homePosition;
private Vector2 idlePosition1; private Vector2 idlePosition1;
private Vector2 idlePosition2; private Vector2 idlePosition2;
@@ -68,6 +77,7 @@ namespace Marro.PacManUdon
// State // State
private PacManGhostState ghostState; private PacManGhostState ghostState;
private bool isScared; private bool isScared;
private bool whiteScared;
private bool scattering; private bool scattering;
private PacManGhostFrozenState frozenState; private PacManGhostFrozenState frozenState;
@@ -76,7 +86,6 @@ namespace Marro.PacManUdon
private int housePelletCounter; private int housePelletCounter;
private bool housePelletCounterActive; private bool housePelletCounterActive;
private int housePelletCounterLimit; private int housePelletCounterLimit;
private bool faceInStartingDirectionUntilUnfrozen;
// Cutscene // Cutscene
private bool kinematic; private bool kinematic;
@@ -89,13 +98,16 @@ namespace Marro.PacManUdon
public bool IsScared => isScared; public bool IsScared => isScared;
public int Index { get; private set; } public int Index { get; private set; }
public void Initialize(PelletManager pelletManager, PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition, int index) private readonly int animatorKeyDirection = Animator.StringToHash("Direction");
private readonly int animatorKeyGhostType = Animator.StringToHash("GhostType");
public void Initialize(CollisionManager collisionManager, PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition, int index)
{ {
ghostManager = transform.parent.GetComponent<GhostManager>(); ghostManager = transform.parent.GetComponent<GhostManager>();
animator = GetComponent<Animator>(); animator = GetComponent<Animator>();
renderer = GetComponent<Renderer>(); renderer = GetComponent<Renderer>();
this.pelletManager = pelletManager; this.collisionManager = collisionManager;
this.pacMan = pacMan; this.pacMan = pacMan;
this.blinky = blinky; this.blinky = blinky;
this.homePosition = homePosition; this.homePosition = homePosition;
@@ -106,47 +118,44 @@ namespace Marro.PacManUdon
scoreBonusDisplay = transform.Find("ScoreBonusDisplay").gameObject.GetComponent<ScoreBonusDisplay>(); scoreBonusDisplay = transform.Find("ScoreBonusDisplay").gameObject.GetComponent<ScoreBonusDisplay>();
scoreBonusDisplay.Initialize(); scoreBonusDisplay.Initialize();
startPosition = startTransform.localPosition; startPosition = startTransform.localPosition;
startRotation = startTransform.localRotation;
frozenState = PacManGhostFrozenState.Frozen; frozenState = PacManGhostFrozenState.Frozen;
Index = index; Index = index;
SubscribeToEvent(NetworkEventType.GhostUpdate); targetIndicator.transform.parent = transform.parent;
} }
public void Reset() public void Reset()
{ {
// Debug.Log($"{gameObject} Reset!"); // Debug.Log($"{gameObject} Reset!");
transform.SetLocalPositionAndRotation(startPosition, startRotation); SetPosition(startPosition);
if (startState == PacManGhostStartState.Outside)
{
ghostState = PacManGhostState.Exiting;
OffGridTargetReached();
}
else
{
if (startState == PacManGhostStartState.TargetingIdlePosition1)
{
SetOffGridTarget(idlePosition1, false);
}
ghostState = PacManGhostState.Entering;
OffGridTargetReached();
}
offGrid = true;
isScared = false; isScared = false;
inTunnel = false; inTunnel = false;
kinematic = false; kinematic = false;
followingPredefinedPath = false; followingPredefinedPath = false;
turnAroundSoon = false; turnAroundSoon = false;
specialLook = false; specialLook = false;
rngState = 1; rngState = 1;
UpdateSpeed();
faceInStartingDirectionUntilUnfrozen = true; ghostState = PacManGhostState.WaitingForStart;
UpdateAnimator();
switch (startState)
{
case PacManGhostStartState.TargetingIdlePosition1:
SetTargetDirection(Direction.Up);
break;
case PacManGhostStartState.TargetingIdlePosition2:
SetTargetDirection(Direction.Down);
break;
default:
SetTargetDirection(Direction.Left);
break;
}
UpdateSpeed();
// Debug.Log($"{gameObject} reset with state: {state}, target: {target}, offGrid: {offGrid}"); // Debug.Log($"{gameObject} reset with state: {state}, target: {target}, offGrid: {offGrid}");
} }
@@ -173,7 +182,7 @@ namespace Marro.PacManUdon
&& CrossesTileCenter(position, nextPosition, direction)) && CrossesTileCenter(position, nextPosition, direction))
{ {
var newDirection = GetInverseDirection(direction); var newDirection = GetInverseDirection(direction);
SetDirection(newDirection); SetDirectionAndTargetDirection(newDirection);
turnAroundSoon = false; turnAroundSoon = false;
return nextPosition; return nextPosition;
} }
@@ -183,29 +192,53 @@ namespace Marro.PacManUdon
return nextPosition; return nextPosition;
} }
if (ghostState == PacManGhostState.WaitingForStart)
{
switch (startState)
{
case PacManGhostStartState.TargetingIdlePosition1:
SetOffGridTarget(idlePosition1, false);
ghostState = PacManGhostState.Entering;
break;
case PacManGhostStartState.TargetingIdlePosition2:
SetOffGridTarget(idlePosition2, false);
ghostState = PacManGhostState.Entering;
break;
default:
ghostState = PacManGhostState.Exiting;
break;
}
OffGridTargetReached();
}
if (offGrid || ghostState == PacManGhostState.Returning) if (offGrid || ghostState == PacManGhostState.Returning)
{ {
PerformOffgridRelatedMovement(position, ref nextPosition); PerformOffgridRelatedMovement(position, ref nextPosition);
} }
if (!offGrid && followingPredefinedPath) if (!offGrid)
{ {
nextPosition = ProcessPredefinedPath(position, nextPosition); if (followingPredefinedPath)
{
ProcessPredefinedPath(position, ref nextPosition);
} }
else if (!offGrid && CrossesTileCenter(position, nextPosition, direction)) else if (CrossesTileCenter(position, nextPosition, direction))
{ {
TryToTurn(position, ref nextPosition); if (targetDirection != direction)
{
ApplyTargetDirection(position, out nextPosition);
} }
else
var distance = Vector2.Distance(position, nextPosition);
if (distance > 0.5f)
{ {
Debug.LogError($"{gameObject} Just jumped by distance {distance}! position: {position}, nextPosition: {nextPosition}, direction: {direction}, offGrid: {offGrid}, ghostState: {ghostState}"); TryToQueueTurn(position);
}
}
} }
if (CrossesTileBorder(position, nextPosition, direction)) if (CrossesTileBorder(position, nextPosition, direction))
{ {
var inTunnel = pelletManager.IsInTunnel(nextPosition); var inTunnel = collisionManager.GhostMoveToTile(nextPosition, Index);
if (inTunnel != this.inTunnel) if (inTunnel != this.inTunnel)
{ {
this.inTunnel = inTunnel; this.inTunnel = inTunnel;
@@ -242,7 +275,7 @@ namespace Marro.PacManUdon
} }
if ((XAxisAlligned || YAxisAlligned) && offGrid) if ((XAxisAlligned || YAxisAlligned) && offGrid)
{ {
SetDirection(GetOffGridDirectionToTarget(nextPosition, target, direction)); SetDirectionAndTargetDirection(GetOffGridDirectionToTarget(nextPosition, target, direction));
// Debug.Log($"{gameObject} Alligned X Axis: {XAxisAlligned}, Y Axis: {YAxisAlligned} with position: {position}, new nextPosition: {nextPosition}, new target: {target}, now moving in direction {direction}"); // Debug.Log($"{gameObject} Alligned X Axis: {XAxisAlligned}, Y Axis: {YAxisAlligned} with position: {position}, new nextPosition: {nextPosition}, new target: {target}, now moving in direction {direction}");
// nextPosition = GridMover.GetNextPosition(position, direction, speed); // nextPosition = GridMover.GetNextPosition(position, direction, speed);
} }
@@ -250,37 +283,63 @@ namespace Marro.PacManUdon
return nextPosition; return nextPosition;
} }
private void TryToTurn(Vector2 position, ref Vector2 nextPosition) private void TryToQueueTurn(Vector2 position)
{ {
var gridPosition = PositionToGrid(position); var upcomingGridPosition = PositionToGrid(position + directionVectors[(int)direction]);
var availableDirections = pelletManager.GetAvailableDirections(position); var availableDirections = collisionManager.GetAvailableDirections(upcomingGridPosition);
if ((availableDirections & (int)PacManCollisionInfoType.NoTurn) != 0) if ((availableDirections & (int)PacManCollisionInfoType.NoTurn) != 0)
{ {
return; return;
} }
availableDirections &= ~(int)GetInverseDirection(direction); // Not allowed to turn around
if (!isScared && (availableDirections & (int)PacManCollisionInfoType.HorizontalOnly) != 0) if (!isScared && (availableDirections & (int)PacManCollisionInfoType.HorizontalOnly) != 0)
{ {
Debug.Log($"{name} Horizontal only!"); availableDirections &= 0b1100;
availableDirections &= ~0b0011; }
availableDirections &= ~(int)GetInverseDirection(direction) & 0b1111; // Not allowed to turn around, also filter flags other than direction
if (availableDirections == 0)
{
return;
}
Direction newDirection;
if (isSingleBitSet[availableDirections])
{
newDirection = (Direction)availableDirections;
}
else
{
target = GetGridTarget(upcomingGridPosition);
targetIndicator.transform.localPosition = target;
newDirection = GetGridDirectionToTargetGreedy(availableDirections, upcomingGridPosition, target);
} }
target = GetGridTarget(gridPosition);
var newDirection = GetGridDirectionToTargetGreedy(availableDirections, gridPosition, target);
if (newDirection == direction) if (newDirection == direction)
{ {
return; return;
} }
//Debug.Log($"{gameObject.name} Turned from direction {direction} to direction {newDirection}"); SetTargetDirection(newDirection);
nextPosition = GetNextPosition(gridPosition, directionVectors[(int)newDirection], speed, networkManager.SyncedDeltaTime);
SetDirection(newDirection);
} }
private Vector2 ProcessPredefinedPath(Vector2 position, Vector2 nextPosition) // Static fields are not yet supported on user-defined types
private readonly bool[] isSingleBitSet = new bool[]
{
//0000,0001, 0010, 0011 , 0100, 0101 , 0110 , 0111 , 1000, 1001 , 1010 , 1011 , 1100 , 1101 , 1110 , 1111
false, true, true, false, true, false, false, false, true, false, false, false, false, false, false, false
};
private void ApplyTargetDirection(Vector2 position, out Vector2 nextPosition)
{
var gridPosition = PositionToGrid(position);
nextPosition = GetNextPosition(gridPosition, directionVectors[(int)targetDirection], speed, networkManager.SyncedDeltaTime);
SetDirection(targetDirection);
}
private void ProcessPredefinedPath(Vector2 position, ref Vector2 nextPosition)
{ {
if (CrossesTileCenter(position, nextPosition, direction)) if (CrossesTileCenter(position, nextPosition, direction))
{ {
@@ -290,13 +349,13 @@ namespace Marro.PacManUdon
{ {
nextValidDirectionIndex += 1; nextValidDirectionIndex += 1;
} }
if (!pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)predefinedPath[nextValidDirectionIndex]])) if (!collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)predefinedPath[nextValidDirectionIndex]]))
{ {
// If we're at a Vector2.zero, we skip applying the direction and only increment. // If we're at a Vector2.zero, we skip applying the direction and only increment.
if (nextValidDirectionIndex == predefinedPathIndex) if (nextValidDirectionIndex == predefinedPathIndex)
{ {
SetDirection(predefinedPath[nextValidDirectionIndex]); SetDirectionAndTargetDirection(predefinedPath[nextValidDirectionIndex]);
nextPosition = PositionToGrid(nextPosition) + GetVector(direction) * 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 // Check if we've reached the end of the path, which includes making sure the path doesn't end on Vector2.zero
do do
@@ -315,69 +374,57 @@ namespace Marro.PacManUdon
predefinedPathIndex++; predefinedPathIndex++;
} }
} }
return nextPosition;
} }
Vector2 GetGridTarget(Vector2 gridPosition) private Vector2 GetGridTarget(Vector2 gridPosition)
{ {
// if (followingPredefinedPath)
// {
// predefinedPathIndex++;
// if (predefinedPathIndex >= predefinedPath.Length)
// {
// followingPredefinedPath = false;
// }
// return gridPosition + predefinedPath[predefinedPathIndex];
// }
if (isScared) if (isScared)
{ {
switch (PseudoRNG() % 4) return gridPosition + directionVectors[(int)cardinalDirections[PseudoRNG() % 4]];
{
default:
return gridPosition;
case 0:
return gridPosition + Vector2.up;
case 1:
return gridPosition + Vector2.left;
case 2:
return gridPosition + Vector2.down;
case 3:
return gridPosition + Vector2.right;
} }
}
switch (ghostState) if (ghostState == PacManGhostState.Returning)
{ {
default: return homePosition;
return gridPosition; }
case PacManGhostState.Normal:
if (scattering) if (scattering)
{ {
return cornerPosition; return cornerPosition;
} }
switch (ghostType) switch (ghostType)
{ {
default: default:
return gridPosition; return gridPosition;
case PacManGhostType.Blinky: case PacManGhostType.Blinky: // Chase PacMan directly
return PositionToGrid(pacMan.transform.localPosition); return PositionToGrid(pacMan.GetPosition());
case PacManGhostType.Pinky: case PacManGhostType.Pinky: // Try to get ahead of PacMan
return PositionToGrid(pacMan.transform.localPosition) + pacMan.GetVector(direction) * 4; return GetTargetAheadOfPacMan(4);
case PacManGhostType.Inky: case PacManGhostType.Inky: // Try to attack from the opposite side of Blinky
return 2 * PositionToGrid(pacMan.transform.localPosition) + 4 * pacMan.GetVector(direction) - PositionToGrid(blinky.transform.localPosition); var blinkyPosition = PositionToGrid(blinky.GetPosition());
case PacManGhostType.Clyde: return ((GetTargetAheadOfPacMan(2) - blinkyPosition) * 2) + blinkyPosition;
if (Vector2.Distance(gridPosition, PositionToGrid(pacMan.transform.localPosition)) >= 8) case PacManGhostType.Clyde: // Chase PacMan, but retreat to corner if PacMan gets to close
var pacManPosition = PositionToGrid(pacMan.GetPosition());
if (Vector2.Distance(gridPosition, pacManPosition) < 8)
{ {
return PositionToGrid(pacMan.transform.localPosition);
}
else
{
// Debug.Log($"{gameObject} goes to cornerPosition {cornerPosition}");
return cornerPosition; return cornerPosition;
} }
return pacManPosition;
} }
case PacManGhostState.Returning:
return homePosition;
} }
private Vector2 GetTargetAheadOfPacMan(int tilesInFront)
{
var direction = pacMan.GetTargetDirection();
var result = PositionToGrid(pacMan.GetPosition()) + directionVectors[(int)direction] * tilesInFront;
if (direction == Direction.Up) // Reproducing a bug in the original game
{
result.x -= tilesInFront;
}
return result;
} }
bool CheckAndAllignToTargetX(Vector2 currentPosition, Vector2 nextPosition, Vector2 target) bool CheckAndAllignToTargetX(Vector2 currentPosition, Vector2 nextPosition, Vector2 target)
@@ -422,7 +469,7 @@ namespace Marro.PacManUdon
case PacManGhostState.Exiting: case PacManGhostState.Exiting:
offGrid = false; offGrid = false;
SetState(PacManGhostState.Normal); SetState(PacManGhostState.Normal);
SetDirection(Direction.Left); SetDirectionAndTargetDirection(Direction.Left);
break; break;
} }
} }
@@ -431,11 +478,11 @@ namespace Marro.PacManUdon
{ {
if (startHorizontal) if (startHorizontal)
{ {
SetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Direction.Right)); SetDirectionAndTargetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Direction.Right));
} }
else else
{ {
SetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Direction.Down)); SetDirectionAndTargetDirection(GetOffGridDirectionToTarget(GetPosition(), newTarget, Direction.Down));
} }
// Debug.Log($"{gameObject} SetOffGridTarget with position {GetPosition()}, newTarget {newTarget}, startHorizontal {startHorizontal} resulted in direction {direction}"); // Debug.Log($"{gameObject} SetOffGridTarget with position {GetPosition()}, newTarget {newTarget}, startHorizontal {startHorizontal} resulted in direction {direction}");
target = newTarget; target = newTarget;
@@ -446,17 +493,16 @@ namespace Marro.PacManUdon
rngState ^= rngState << 13; rngState ^= rngState << 13;
rngState ^= rngState >> 17; rngState ^= rngState >> 17;
rngState ^= rngState << 5; rngState ^= rngState << 5;
return rngState; return Math.Abs(rngState);
} }
private readonly Direction[] cardinalDirections = new Direction[] { Direction.Up, Direction.Left, Direction.Down, Direction.Right }; private readonly Direction[] cardinalDirections = new Direction[] { Direction.Up, Direction.Left, Direction.Down, Direction.Right };
private readonly Direction[] horizontalDirections = new Direction[] { Direction.Left, Direction.Right };
Direction GetGridDirectionToTargetGreedy(int availableDirections, Vector2 gridPosition, Vector2 targetGridPosition) Direction GetGridDirectionToTargetGreedy(int availableDirections, Vector2 gridPosition, Vector2 targetGridPosition)
{ {
Direction bestDirection = Direction.Zero; Direction bestDirection = Direction.Zero;
float bestDistance = float.MaxValue; float bestDistance = float.MaxValue;
foreach (var direction in horizontalOnly ? horizontalDirections : cardinalDirections) foreach (var direction in cardinalDirections)
{ {
if (((int)direction & availableDirections) == 0) if (((int)direction & availableDirections) == 0)
{ {
@@ -494,82 +540,41 @@ namespace Marro.PacManUdon
if (!gameObject.activeInHierarchy) if (!gameObject.activeInHierarchy)
return; return;
// Debug.Log($"{gameObject} UpdateAnimator with state: {ghostState}, isScared: {isScared}, direction: {direction}"); if (frozenState == PacManGhostFrozenState.FrozenIfNotCaught) // Looks like a bug but matches the original game
if (specialLook)
{
animator.SetFloat("GhostType", GhostTypeToAnimationValue(PacManGhostType.Special));
}
else if (isScared)
{
float currentGhostType = animator.GetFloat("GhostType");
if (currentGhostType > 0.5f && currentGhostType < 2.5f)
{ {
return; return;
} }
animator.SetFloat("GhostType", GhostTypeToAnimationValue(PacManGhostType.Scared));
} if (specialLook || targetDirection != Direction.Zero)
else
{ {
switch (ghostState) SetAnimatorDirection((int)targetDirection);
{
default:
case PacManGhostState.Normal:
case PacManGhostState.Home:
case PacManGhostState.Exiting:
// Debug.Log($"{gameObject} Set GhostType in animator to: {GhostTypeToAnimationValue(ghostType)}");
animator.SetFloat("GhostType", GhostTypeToAnimationValue(ghostType));
break;
case PacManGhostState.Returning:
case PacManGhostState.Entering:
animator.SetFloat("GhostType", GhostTypeToAnimationValue(PacManGhostType.Caught));
break;
}
} }
if (faceInStartingDirectionUntilUnfrozen && startState == PacManGhostStartState.TargetingIdlePosition1) PacManGhostType ghostType = this.ghostType;
if (isScared)
{ {
animator.SetFloat("DirX", 0); ghostType = whiteScared ? PacManGhostType.ScaredWhite : PacManGhostType.Scared;
animator.SetFloat("DirY", 1);
} }
else if (faceInStartingDirectionUntilUnfrozen && startState == PacManGhostStartState.TargetingIdlePosition2) else if (ghostState == PacManGhostState.Returning || ghostState == PacManGhostState.Entering)
{ {
animator.SetFloat("DirX", 0); ghostType = PacManGhostType.Caught;
animator.SetFloat("DirY", -1);
} }
else if (specialLook || direction != Direction.Zero) else if (specialLook)
{ {
var vector = GetVector(direction); ghostType = PacManGhostType.Special;
animator.SetFloat("DirX", vector.x);
animator.SetFloat("DirY", vector.y);
}
} }
private float GhostTypeToAnimationValue(PacManGhostType ghostType) SetAnimatorGhostType((int)ghostType);
{
switch (ghostType)
{
default:
Debug.LogError("Invalid ghost animation value!");
return 0;
case PacManGhostType.Caught:
return 0;
case PacManGhostType.Scared:
return 1;
case PacManGhostType.ScaredWhite:
return 2;
case PacManGhostType.Blinky:
return 3;
case PacManGhostType.Pinky:
return 4;
case PacManGhostType.Inky:
return 5;
case PacManGhostType.Clyde:
return 6;
case PacManGhostType.Special:
return 7;
}
} }
// A Udon bug means converting an enum to a float causes an exception unless the conversion from int to float is in a separate method
private void SetAnimatorDirection(int value) =>
animator.SetFloat(animatorKeyDirection, value);
private void SetAnimatorGhostType(int value) =>
animator.SetFloat(animatorKeyGhostType, value);
public void UpdateSpeed() public void UpdateSpeed()
{ {
speed = ghostManager.GetTargetSpeed(this, ghostState, isScared, inTunnel); speed = ghostManager.GetTargetSpeed(this, ghostState, isScared, inTunnel);
@@ -595,6 +600,25 @@ namespace Marro.PacManUdon
} }
} }
internal bool HitPacMan()
{
if (ghostState != PacManGhostState.Normal)
{
return false;
}
if (isScared)
{
//Debug.Log($"{gameObject} was cought!");
ghostManager.GhostCaught(this);
return true;
}
//Debug.Log($"{gameObject} cought PacMan!");
ghostManager.CapturedPacMan();
return true;
}
public void Caught(int scoreBonus) public void Caught(int scoreBonus)
{ {
isScared = false; isScared = false;
@@ -656,13 +680,8 @@ namespace Marro.PacManUdon
private void SetScared(bool scared) private void SetScared(bool scared)
{ {
isScared = scared; isScared = scared;
UpdateAnimator();
UpdateSpeed();
if (isScared)
{
SetWhite(false); SetWhite(false);
} UpdateSpeed();
} }
public void SetScattering(bool scattering, bool reverseDirection = true) public void SetScattering(bool scattering, bool reverseDirection = true)
@@ -683,25 +702,32 @@ namespace Marro.PacManUdon
public void SetFrozen(bool frozen, bool ignoreIfCaught = false, bool keepAnimating = false) public void SetFrozen(bool frozen, bool ignoreIfCaught = false, bool keepAnimating = false)
{ {
animator.speed = frozen && !keepAnimating ? 0 : 1; // This would cause issues if the returning sprite was animated, luckily it isn't :)
if (frozen && !ignoreIfCaught) if (frozen && !ignoreIfCaught)
{ {
frozenState = PacManGhostFrozenState.Frozen; frozenState = PacManGhostFrozenState.Frozen;
return;
} }
else if (frozen && ignoreIfCaught)
if (frozen && ignoreIfCaught)
{ {
frozenState = PacManGhostFrozenState.FrozenIfNotCaught; frozenState = PacManGhostFrozenState.FrozenIfNotCaught;
return;
} }
else
{
frozenState = PacManGhostFrozenState.NotFrozen;
}
animator.speed = frozen && !keepAnimating ? 0 : 1; // This would cause issues if the returning sprite was animated, luckily it isn't :)
if (frozen == false && faceInStartingDirectionUntilUnfrozen) var oldFrozenState = frozenState;
frozenState = PacManGhostFrozenState.NotFrozen;
if (oldFrozenState == PacManGhostFrozenState.FrozenIfNotCaught) // Catch animator up after not updating during FrozenIfNotCaught
{ {
faceInStartingDirectionUntilUnfrozen = false;
UpdateAnimator(); UpdateAnimator();
} }
if (ghostState == PacManGhostState.CaughtScore)
{
ReturnHome(); // Return home when unfreezing after being caught
}
} }
public void SetHousePelletCounterActive(bool active) public void SetHousePelletCounterActive(bool active)
@@ -716,17 +742,8 @@ namespace Marro.PacManUdon
public void SetWhite(bool white) public void SetWhite(bool white)
{ {
if (!isScared || !gameObject.activeInHierarchy) whiteScared = white;
return; UpdateAnimator();
if (white)
{
animator.SetFloat("GhostType", 2);
}
else
{
animator.SetFloat("GhostType", 1);
}
} }
public void SetElroy(int elroyLevel) public void SetElroy(int elroyLevel)
@@ -791,7 +808,7 @@ namespace Marro.PacManUdon
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.GhostUpdate) if (eventType != NetworkEventType.FullSync)
{ {
return; return;
} }
@@ -805,21 +822,22 @@ namespace Marro.PacManUdon
data.AppendAsByte((int)ghostState, ref index); data.AppendAsByte((int)ghostState, ref index);
data.Append(isScared, ref index); data.Append(isScared, ref index);
data.Append(whiteScared, ref index);
data.Append(scattering, ref index); data.Append(scattering, ref index);
data.AppendAsByte((int)frozenState, ref index);
data.Append(offGrid, ref index); data.Append(offGrid, ref index);
data.AppendAsByte(housePelletCounter, ref index); data.AppendAsByte(housePelletCounter, ref index);
data.Append(housePelletCounterActive, ref index); data.Append(housePelletCounterActive, ref index);
data.AppendAsByte(housePelletCounterLimit, ref index); data.AppendAsByte(housePelletCounterLimit, ref index);
data.Append(faceInStartingDirectionUntilUnfrozen, ref index);
base.CollectSyncedData(data, ref index, eventType); base.CollectSyncedData(data, ref index, eventType);
data.AppendAsByte((int)frozenState, ref index);
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.GhostUpdate) if (eventType != NetworkEventType.FullSync)
{ {
return true; return true;
} }
@@ -833,33 +851,23 @@ namespace Marro.PacManUdon
ghostState = (PacManGhostState)data.ReadByte(ref index); ghostState = (PacManGhostState)data.ReadByte(ref index);
isScared = data.ReadBool(ref index); isScared = data.ReadBool(ref index);
whiteScared = data.ReadBool(ref index);
scattering = data.ReadBool(ref index); scattering = data.ReadBool(ref index);
frozenState = (PacManGhostFrozenState)data.ReadByte(ref index);
offGrid = data.ReadBool(ref index); offGrid = data.ReadBool(ref index);
housePelletCounter = data.ReadByte(ref index); housePelletCounter = data.ReadByte(ref index);
housePelletCounterActive = data.ReadBool(ref index); housePelletCounterActive = data.ReadBool(ref index);
housePelletCounterLimit = data.ReadByte(ref index); housePelletCounterLimit = data.ReadByte(ref index);
faceInStartingDirectionUntilUnfrozen = data.ReadBool(ref index);
return base.WriteSyncedData(data, ref index, eventType); UpdateSpeed();
}
void OnTriggerEnter(Collider other) frozenState = PacManGhostFrozenState.NotFrozen; // Ensure UpdateAnimator runs fully
{
if (other.gameObject.GetComponent<PacManGhostCollider>()) var success = base.WriteSyncedData(data, ref index, eventType);
{
if (isScared) frozenState = (PacManGhostFrozenState)data.ReadByte(ref index);
{
// Debug.Log($"{gameObject} was cought!"); return success;
ghostManager.GhostCaughtQueue(this);
}
else if (ghostState == PacManGhostState.Normal)
{
// Debug.Log($"{gameObject} cought PacMan!");
ghostManager.CapturedPacMan();
}
}
} }
} }
} }

View File

@@ -43,7 +43,7 @@ MonoBehaviour:
Data: Data:
- Name: - Name:
Entry: 12 Entry: 12
Data: 33 Data: 32
- Name: - Name:
Entry: 7 Entry: 7
Data: Data:
@@ -283,19 +283,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: pelletManager Data: collisionManager
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: pelletManager Data: collisionManager
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 18|System.RuntimeType, mscorlib Data: 18|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.PelletManager, Assembly-CSharp Data: Marro.PacManUdon.CollisionManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -1081,64 +1081,10 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: ghostScaredQueue Data: blinkingActivated
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ghostScaredQueue
- Name: <UserType>k__BackingField
Entry: 7
Data: 55|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Data.DataList, VRCSDK3
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 55
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: blinkingActivated
- Name: $v
Entry: 7
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: blinkingActivated Data: blinkingActivated
@@ -1162,7 +1108,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1186,7 +1132,7 @@ MonoBehaviour:
Data: blinkCountdown Data: blinkCountdown
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: blinkCountdown Data: blinkCountdown
@@ -1210,7 +1156,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1234,7 +1180,7 @@ MonoBehaviour:
Data: blinkCurrentlyWhite Data: blinkCurrentlyWhite
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: blinkCurrentlyWhite Data: blinkCurrentlyWhite
@@ -1258,7 +1204,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1282,7 +1228,7 @@ MonoBehaviour:
Data: scatterCounter Data: scatterCounter
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: scatterCounter Data: scatterCounter
@@ -1306,7 +1252,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1330,7 +1276,7 @@ MonoBehaviour:
Data: scatterPatternIndex Data: scatterPatternIndex
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: scatterPatternIndex Data: scatterPatternIndex
@@ -1354,7 +1300,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1378,7 +1324,7 @@ MonoBehaviour:
Data: elroyLevel Data: elroyLevel
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: elroyLevel Data: elroyLevel
@@ -1402,7 +1348,7 @@ MonoBehaviour:
Data: true Data: true
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1426,7 +1372,7 @@ MonoBehaviour:
Data: sharedPelletCounterActive Data: sharedPelletCounterActive
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: sharedPelletCounterActive Data: sharedPelletCounterActive
@@ -1450,7 +1396,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 70|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1474,7 +1420,7 @@ MonoBehaviour:
Data: sharedPelletCounter Data: sharedPelletCounter
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: sharedPelletCounter Data: sharedPelletCounter
@@ -1496,6 +1442,60 @@ MonoBehaviour:
- Name: <IsSerialized>k__BackingField - Name: <IsSerialized>k__BackingField
Entry: 5 Entry: 5
Data: false Data: false
- Name: _fieldAttributes
Entry: 7
Data: 69|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: sharedPelletCounterReleaseValues
- Name: $v
Entry: 7
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: sharedPelletCounterReleaseValues
- Name: <UserType>k__BackingField
Entry: 7
Data: 71|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32[], mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 71
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
@@ -1519,64 +1519,10 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: sharedPelletCounterReleaseValues Data: pelletTimeout
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: sharedPelletCounterReleaseValues
- Name: <UserType>k__BackingField
Entry: 7
Data: 74|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32[], mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 74
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: pelletTimeout
- Name: $v
Entry: 7
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: pelletTimeout Data: pelletTimeout
@@ -1600,7 +1546,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1624,7 +1570,7 @@ MonoBehaviour:
Data: frozen Data: frozen
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 78|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: frozen Data: frozen
@@ -1648,7 +1594,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 79|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 76|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1672,7 +1618,7 @@ MonoBehaviour:
Data: kinematic Data: kinematic
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 80|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: kinematic Data: kinematic
@@ -1696,7 +1642,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 81|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 78|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0

View File

@@ -11,7 +11,7 @@ namespace Marro.PacManUdon
private Ghost[] ghosts; private Ghost[] ghosts;
private Ghost blinky; private Ghost blinky;
private PelletManager pelletManager; private CollisionManager collisionManager;
// Level constants // Level constants
private float speedDefault; private float speedDefault;
@@ -33,8 +33,6 @@ namespace Marro.PacManUdon
private float powerPelletCountdown; private float powerPelletCountdown;
private int powerPelletMultiplier; private int powerPelletMultiplier;
private DataList ghostScaredQueue;
// Blink logic // Blink logic
private const float blinkCycleRate = 0.233333333f; private const float blinkCycleRate = 0.233333333f;
private bool blinkingActivated; private bool blinkingActivated;
@@ -57,10 +55,10 @@ namespace Marro.PacManUdon
private bool frozen; private bool frozen;
private bool kinematic; private bool kinematic;
public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, PelletManager pelletManager, GameManager gameController) public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, CollisionManager collisionManager, GameManager gameController)
{ {
this.gameController = gameController; this.gameController = gameController;
this.pelletManager = pelletManager; this.collisionManager = collisionManager;
ghosts = transform.GetComponentsInChildren<Ghost>(true); ghosts = transform.GetComponentsInChildren<Ghost>(true);
blinky = ghosts[0]; blinky = ghosts[0];
@@ -72,15 +70,12 @@ namespace Marro.PacManUdon
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition; Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition;
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition; Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition;
ghosts[ghostIndex].Initialize(pelletManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex); ghosts[ghostIndex].Initialize(collisionManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex);
} }
SubscribeToEvent(NetworkEventType.GhostUpdate);
} }
public void RestartLevel(bool afterLifeLost = false) public void RestartLevel(bool afterLifeLost = false)
{ {
ghostScaredQueue = new DataList();
powerPelletActive = false; powerPelletActive = false;
scatterCounter = 0; scatterCounter = 0;
scatterPatternIndex = 0; scatterPatternIndex = 0;
@@ -94,18 +89,15 @@ namespace Marro.PacManUdon
SetSharedPelletCounterActive(true); SetSharedPelletCounterActive(true);
} }
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.Reset(); ghost.Reset();
} }
SetScattering(true, reverseDirection: false); SetScattering(true, reverseDirection: false);
}
public void NewLevel()
{
SetSharedPelletCounterActive(false); SetSharedPelletCounterActive(false);
UpdateElroyLevel(pelletManager.PelletCount); UpdateElroyLevel(collisionManager.PelletCount);
foreach (Ghost ghost in ghosts) foreach (Ghost ghost in ghosts)
{ {
ghost.ResetHousePelletCounter(); ghost.ResetHousePelletCounter();
@@ -176,7 +168,7 @@ namespace Marro.PacManUdon
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++) for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{ {
Ghost ghost = ghosts[ghostIndex]; var ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home) if (ghost.GetGhostState() == PacManGhostState.Home)
{ {
ghost.Release(); ghost.Release();
@@ -186,7 +178,7 @@ namespace Marro.PacManUdon
} }
} }
public void GhostCaughtQueue(Ghost ghost) public void GhostCaught(Ghost ghost)
{ {
if (gameController.GameState == PacManGameState.AttractMode) if (gameController.GameState == PacManGameState.AttractMode)
{ {
@@ -194,34 +186,6 @@ namespace Marro.PacManUdon
return; return;
} }
// Debug.Log($"{gameObject} GhostCaughtQueue with ghost {ghost}");
//networkManager.SendEventSoon(NetworkEventType.TimeSequenceSync);
//networkManager.SendEventSoon(NetworkEventType.GhostUpdate);
ghostScaredQueue.Add(ghost);
GhostCaughtExecute(ghost);
}
public void GhostCaughtContinue()
{
// Debug.Log($"{gameObject} GhostCaughtContinue with ghost queue length {ghostScaredQueue.Count}");
if (!ghostScaredQueue.TryGetValue(0, out DataToken currentGhost))
{
Debug.LogError("Called GhostCaughtContinue without a ghost in the queue!");
return;
}
((Ghost)currentGhost.Reference).ReturnHome();
ghostScaredQueue.RemoveAt(0);
if (ghostScaredQueue.TryGetValue(0, out DataToken nextGhost))
{
GhostCaughtExecute((Ghost)nextGhost.Reference);
}
}
void GhostCaughtExecute(Ghost ghost)
{
int scoreBonus = 200 * (int)Math.Pow(2, powerPelletMultiplier); int scoreBonus = 200 * (int)Math.Pow(2, powerPelletMultiplier);
powerPelletMultiplier += 1; powerPelletMultiplier += 1;
ghost.Caught(scoreBonus); ghost.Caught(scoreBonus);
@@ -277,7 +241,7 @@ namespace Marro.PacManUdon
void SetGhostBlinkingState(bool white) void SetGhostBlinkingState(bool white)
{ {
blinkCurrentlyWhite = white; blinkCurrentlyWhite = white;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetWhite(white); ghost.SetWhite(white);
} }
@@ -292,7 +256,7 @@ namespace Marro.PacManUdon
powerPelletCountdown = powerPelletDuration; powerPelletCountdown = powerPelletDuration;
powerPelletMultiplier = 0; powerPelletMultiplier = 0;
SetGhostBlinking(false); SetGhostBlinking(false);
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.BecomeScared(); ghost.BecomeScared();
} }
@@ -310,7 +274,7 @@ namespace Marro.PacManUdon
public void SetFrozen(bool frozen, bool ignoreIfCaught = false) public void SetFrozen(bool frozen, bool ignoreIfCaught = false)
{ {
this.frozen = frozen; this.frozen = frozen;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetFrozen(frozen, ignoreIfCaught: ignoreIfCaught); ghost.SetFrozen(frozen, ignoreIfCaught: ignoreIfCaught);
} }
@@ -325,7 +289,7 @@ namespace Marro.PacManUdon
for (int i = 0; i < ghosts.Length; i++) for (int i = 0; i < ghosts.Length; i++)
{ {
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]); ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
RestartLevel(); // Reset needed to properly apply level ghosts[i].UpdateSpeed();
} }
} }
@@ -380,7 +344,7 @@ namespace Marro.PacManUdon
void SetScattering(bool scattering, bool reverseDirection = true) void SetScattering(bool scattering, bool reverseDirection = true)
{ {
//Debug.Log($"{gameObject} SetScattering: {scattering}"); //Debug.Log($"{gameObject} SetScattering: {scattering}");
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
if (ghost == blinky && elroyLevel > 0) // Once blinky is elroy he no longer scatters if (ghost == blinky && elroyLevel > 0) // Once blinky is elroy he no longer scatters
{ {
@@ -398,7 +362,7 @@ namespace Marro.PacManUdon
{ {
//Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}"); //Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}");
sharedPelletCounterActive = active; sharedPelletCounterActive = active;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetHousePelletCounterActive(!active); ghost.SetHousePelletCounterActive(!active);
} }
@@ -426,7 +390,7 @@ namespace Marro.PacManUdon
//Debug.Log($"Incremented shared pellet counter to {sharedPelletCounter}"); //Debug.Log($"Incremented shared pellet counter to {sharedPelletCounter}");
for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++) for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++)
{ {
Ghost ghost = ghosts[ghostIndex]; var ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home && sharedPelletCounter == sharedPelletCounterReleaseValues[ghostIndex]) if (ghost.GetGhostState() == PacManGhostState.Home && sharedPelletCounter == sharedPelletCounterReleaseValues[ghostIndex])
{ {
ghost.Release(); ghost.Release();
@@ -443,7 +407,7 @@ namespace Marro.PacManUdon
{ {
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++) for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{ {
Ghost ghost = ghosts[ghostIndex]; var ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home) if (ghost.GetGhostState() == PacManGhostState.Home)
{ {
ghost.IncrementHousePelletCounter(); ghost.IncrementHousePelletCounter();
@@ -470,7 +434,7 @@ namespace Marro.PacManUdon
public void SetActive(bool active) public void SetActive(bool active)
{ {
gameObject.SetActive(active); gameObject.SetActive(active);
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetActive(active); ghost.SetActive(active);
} }
@@ -479,7 +443,7 @@ namespace Marro.PacManUdon
public void SetKinematic(bool kinematic) public void SetKinematic(bool kinematic)
{ {
this.kinematic = kinematic; this.kinematic = kinematic;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetKinematic(kinematic); ghost.SetKinematic(kinematic);
} }
@@ -487,11 +451,6 @@ namespace Marro.PacManUdon
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.GhostUpdate)
{
return;
}
// Power Pellet logic // Power Pellet logic
data.Append(powerPelletActive, ref index); data.Append(powerPelletActive, ref index);
data.Append(powerPelletCountdown, ref index); data.Append(powerPelletCountdown, ref index);
@@ -519,28 +478,14 @@ namespace Marro.PacManUdon
data.AppendAsByte(gameController.Level, ref index); data.AppendAsByte(gameController.Level, ref index);
var ghostScaredQueueArray = new byte[ghosts.Length]; foreach (var ghost in ghosts)
for (int i = 0; i < ghostScaredQueueArray.Length; i++)
{ {
var add = ghostScaredQueue.TryGetValue(i, out var ghost); ghost.CollectSyncedData(data, ref index, eventType);
if (!add)
{
ghostScaredQueueArray[i] = byte.MaxValue; // Add a terminator
break;
} }
ghostScaredQueueArray[i] = (byte)((Ghost)ghost.Reference).Index;
}
//Debug.Log($"{gameObject} Sent a ghostScareQueue of length {ghostScaredQueue.Count}");
data.Append(ghostScaredQueueArray, ref index);
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.GhostUpdate)
{
return true;
}
// Power Pellet logic // Power Pellet logic
powerPelletActive = data.ReadBool(ref index); powerPelletActive = data.ReadBool(ref index);
powerPelletCountdown = data.ReadFloat(ref index); powerPelletCountdown = data.ReadFloat(ref index);
@@ -569,18 +514,10 @@ namespace Marro.PacManUdon
var level = data.ReadByte(ref index); var level = data.ReadByte(ref index);
SetLevelConstants(level); SetLevelConstants(level);
ghostScaredQueue.Clear(); foreach (var ghost in ghosts)
for (int i = 0; i < ghosts.Length; i++)
{ {
var ghostIndex = data[index + i]; ghost.WriteSyncedData(data, ref index, eventType);
if (ghostIndex > ghosts.Length) // Reached terminator
{
break;
} }
ghostScaredQueue.Add(ghosts[ghostIndex]);
}
index += ghosts.Length;
//Debug.Log($"{gameObject} Read back a ghostScareQueue of length {ghostScaredQueue.Count}");
return true; return true;
} }

View File

@@ -17,84 +17,70 @@ namespace Marro.PacManUdon
public abstract class GridMover : SyncedObject public abstract class GridMover : SyncedObject
{ {
protected Vector2 position;
protected Direction direction; protected Direction direction;
protected Direction targetDirection;
// Cannot be static, much to my annoyance // Cannot be static
public readonly Vector2[] directionVectors = public readonly Vector2[] directionVectors =
{ {
Vector2.zero, // 0 Vector2.zero, // 0
Vector2.down, // 1 Vector2.up, // 1
Vector2.up, // 2 Vector2.down, // 2
Vector2.zero, // 3 Vector2.zero, // 3
Vector2.left, // 4 Vector2.left, // 4
Vector2.down + Vector2.left, // 5 Vector2.up + Vector2.left, // 5
Vector2.up + Vector2.left, // 6 Vector2.down + Vector2.left, // 6
Vector2.left, // 7 Vector2.left, // 7
Vector2.right, // 8 Vector2.right, // 8
Vector2.down + Vector2.right, // 9 Vector2.up + Vector2.right, // 9
Vector2.up + Vector2.right, // 10 Vector2.down + Vector2.right, // 10
Vector2.right, // 11 Vector2.right, // 11
Vector2.zero, // 12 Vector2.zero, // 12
Vector2.down, // 13 Vector2.up, // 13
Vector2.up, // 14 Vector2.down, // 14
Vector2.zero, // 15 Vector2.zero, // 15
}; };
public virtual Vector2 GetPosition() public virtual Vector2 GetPosition()
{ {
return (Vector2)transform.localPosition; //return (Vector2)transform.localPosition;
return position;
} }
public virtual void SetPosition(Vector2 position) public virtual void SetPosition(Vector2 position)
{ {
this.position = position;
transform.localPosition = new Vector3(position.x, position.y, transform.localPosition.z); transform.localPosition = new Vector3(position.x, position.y, transform.localPosition.z);
} }
public Vector2 GetVector(Direction direction)
{
return directionVectors[(int)direction];
}
public Direction GetDirection() public Direction GetDirection()
{ {
return direction; return direction;
} }
public Direction GetTargetDirection()
{
return targetDirection;
}
public void SetDirection(Direction direction) public void SetDirection(Direction direction)
{ {
this.direction = direction; this.direction = direction;
UpdateAnimator(); UpdateAnimator();
} }
public void SetDirection(Vector2 vector) protected void SetTargetDirection(Direction targetDirection)
{ {
direction = VectorToDirection(vector); this.targetDirection = targetDirection;
UpdateAnimator(); UpdateAnimator();
} }
protected static Direction VectorToDirection(Vector2 vector) public void SetDirectionAndTargetDirection(Direction direction)
{ {
var directionId = 0; this.direction = direction;
this.targetDirection = direction;
if (vector.x < 0) UpdateAnimator();
{
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) protected static Direction HorizontalToDirection(float horizontal)
@@ -114,11 +100,11 @@ namespace Marro.PacManUdon
{ {
if (vertical < 0) if (vertical < 0)
{ {
return Direction.Up; return Direction.Down;
} }
if (vertical > 0) if (vertical > 0)
{ {
return Direction.Down; return Direction.Up;
} }
return Direction.Zero; return Direction.Zero;
} }
@@ -129,26 +115,22 @@ namespace Marro.PacManUdon
{ {
data.Append(GetPosition(), ref index); data.Append(GetPosition(), ref index);
data.AppendAsByte((int)direction, ref index); data.AppendAsByte((int)direction, ref index);
} data.AppendAsByte((int)targetDirection, ref index);
public void PadSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
index += 9;
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
SetPosition(data.ReadVector2(ref index)); SetPosition(data.ReadVector2(ref index));
SetDirection((Direction)data.ReadByte(ref index)); direction = (Direction)data.ReadByte(ref index);
targetDirection = (Direction)data.ReadByte(ref index);
UpdateAnimator();
return true; return true;
} }
public bool ConsumeSyncedData(byte[] data, ref int index, NetworkEventType eventType) public void PadSyncedData(ref int index)
{ {
index += 9; index += 10;
return true;
} }
#region Utils #region Utils
@@ -223,6 +205,7 @@ namespace Marro.PacManUdon
{ {
result = Math.Round(currentPosition.y) != Math.Round(nextPosition.y); result = Math.Round(currentPosition.y) != Math.Round(nextPosition.y);
} }
return result; return result;
} }
#endregion #endregion

View File

@@ -143,15 +143,5 @@ namespace Marro.PacManUdon
{ {
return (Vector2)transform.localPosition; return (Vector2)transform.localPosition;
} }
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
return true;
}
} }
} }

View File

@@ -43,7 +43,7 @@ MonoBehaviour:
Data: Data:
- Name: - Name:
Entry: 12 Entry: 12
Data: 39 Data: 41
- Name: - Name:
Entry: 7 Entry: 7
Data: Data:
@@ -1009,13 +1009,13 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: eventsToSend Data: eventsToSendEarly
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: eventsToSend Data: eventsToSendEarly
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 55|System.RuntimeType, mscorlib Data: 55|System.RuntimeType, mscorlib
@@ -1063,13 +1063,13 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: eventsToSendIndex Data: eventsToSendEarlyIndex
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: eventsToSendIndex Data: eventsToSendEarlyIndex
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 11 Data: 11
@@ -1111,16 +1111,112 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: eventsQueue Data: eventsToSendLate
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: eventsToSendLate
- Name: <UserType>k__BackingField
Entry: 9
Data: 55
- Name: <SystemType>k__BackingField
Entry: 9
Data: 32
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 60|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: eventsToSendLateIndex
- Name: $v
Entry: 7
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: eventsToSendLateIndex
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 62|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: eventsQueue
- Name: $v
Entry: 7
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: eventsQueue Data: eventsQueue
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 60|System.RuntimeType, mscorlib Data: 64|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Byte[][], mscorlib Data: System.Byte[][], mscorlib
@@ -1142,102 +1238,6 @@ MonoBehaviour:
- Name: <IsSerialized>k__BackingField - Name: <IsSerialized>k__BackingField
Entry: 5 Entry: 5
Data: false Data: false
- Name: _fieldAttributes
Entry: 7
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: eventsQueueIndex
- Name: $v
Entry: 7
Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: eventsQueueIndex
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: eventsQueueIndexAtLastTransmission
- Name: $v
Entry: 7
Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: eventsQueueIndexAtLastTransmission
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
@@ -1261,19 +1261,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: eventTransmissionHistory Data: eventsQueueIndex
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: eventTransmissionHistory Data: eventsQueueIndex
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 32 Data: 11
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 32 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1309,13 +1309,13 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: eventTransmissionHistoryIndex Data: eventsQueueIndexAtLastTransmission
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: eventTransmissionHistoryIndex Data: eventsQueueIndexAtLastTransmission
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 11 Data: 11
@@ -1357,19 +1357,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: lastEventTransmissionTime Data: eventTransmissionHistory
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: lastEventTransmissionTime Data: eventTransmissionHistory
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 11 Data: 32
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 11 Data: 32
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1405,25 +1405,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: lastEventId Data: eventTransmissionHistoryIndex
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: lastEventId Data: eventTransmissionHistoryIndex
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 73|System.RuntimeType, mscorlib Data: 11
- Name:
Entry: 1
Data: System.Byte, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 73 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1438,7 +1432,109 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib 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: lastEventTransmissionTime
- Name: $v
Entry: 7
Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: lastEventTransmissionTime
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: lastEventId
- Name: $v
Entry: 7
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: lastEventId
- Name: <UserType>k__BackingField
Entry: 7
Data: 77|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Byte, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 77
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 78|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1462,13 +1558,13 @@ MonoBehaviour:
Data: networkedData Data: networkedData
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: networkedData Data: networkedData
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 76|System.RuntimeType, mscorlib Data: 80|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Byte[], mscorlib Data: System.Byte[], mscorlib
@@ -1477,7 +1573,7 @@ MonoBehaviour:
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 76 Data: 80
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1492,13 +1588,13 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 81|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 1
- Name: - Name:
Entry: 7 Entry: 7
Data: 78|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime Data: 82|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -1520,114 +1616,18 @@ MonoBehaviour:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: ready Data: ready
- Name: $v
Entry: 7
Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ready
- Name: <UserType>k__BackingField
Entry: 9
Data: 25
- Name: <SystemType>k__BackingField
Entry: 9
Data: 25
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: synced
- Name: $v
Entry: 7
Data: 81|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: synced
- Name: <UserType>k__BackingField
Entry: 9
Data: 25
- Name: <SystemType>k__BackingField
Entry: 9
Data: 25
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: <SyncedTimeTicks>k__BackingField
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 83|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 83|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: <SyncedTimeTicks>k__BackingField Data: ready
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 11 Data: 25
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 11 Data: 25
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1663,19 +1663,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: <SyncedTime>k__BackingField Data: synced
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 85|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 85|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: <SyncedTime>k__BackingField Data: synced
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 21 Data: 25
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 21 Data: 25
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1711,19 +1711,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: <IsEventUpdate>k__BackingField Data: <SyncedTimeTicks>k__BackingField
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 87|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 87|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: <IsEventUpdate>k__BackingField Data: <SyncedTimeTicks>k__BackingField
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 25 Data: 11
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 25 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1759,19 +1759,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: isOwner Data: <SyncedTime>k__BackingField
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: isOwner Data: <SyncedTime>k__BackingField
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 25 Data: 21
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 25 Data: 21
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1807,25 +1807,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: debugOutput Data: <IsEventUpdate>k__BackingField
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 91|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 91|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: debugOutput Data: <IsEventUpdate>k__BackingField
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 92|System.RuntimeType, mscorlib Data: 25
- Name:
Entry: 1
Data: TMPro.TMP_InputField, Unity.TextMeshPro
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 92 Data: 25
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1837,19 +1831,13 @@ MonoBehaviour:
Data: Data:
- Name: <IsSerialized>k__BackingField - Name: <IsSerialized>k__BackingField
Entry: 5 Entry: 5
Data: true Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 93|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 92|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 0
- Name:
Entry: 7
Data: 94|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: - Name:
Entry: 13 Entry: 13
Data: Data:
@@ -1867,19 +1855,67 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: DebugImageToIndicateOwner Data: isOwner
- Name: $v
Entry: 7
Data: 93|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: isOwner
- Name: <UserType>k__BackingField
Entry: 9
Data: 25
- Name: <SystemType>k__BackingField
Entry: 9
Data: 25
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 94|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: debugOutput
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: DebugImageToIndicateOwner Data: debugOutput
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 96|System.RuntimeType, mscorlib Data: 96|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule Data: TMPro.TMP_InputField, Unity.TextMeshPro
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -1927,19 +1963,80 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: DebugImageToIndicateSynced Data: DebugImageToIndicateOwner
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: DebugImageToIndicateOwner
- Name: <UserType>k__BackingField
Entry: 7
Data: 100|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 100
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 101|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 102|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: DebugImageToIndicateSynced
- Name: $v
Entry: 7
Data: 103|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: DebugImageToIndicateSynced Data: DebugImageToIndicateSynced
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 96 Data: 100
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 96 Data: 100
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1954,14 +2051,14 @@ MonoBehaviour:
Data: true Data: true
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 100|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], Data: 104|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 1
- Name: - Name:
Entry: 7 Entry: 7
Data: 101|UnityEngine.SerializeField, UnityEngine.CoreModule Data: 105|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -1985,16 +2082,16 @@ MonoBehaviour:
Data: DebugImageToIndicateReady Data: DebugImageToIndicateReady
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 102|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 106|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: DebugImageToIndicateReady Data: DebugImageToIndicateReady
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 96 Data: 100
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 96 Data: 100
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -2009,14 +2106,14 @@ MonoBehaviour:
Data: true Data: true
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 103|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], Data: 107|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 1 Data: 1
- Name: - Name:
Entry: 7 Entry: 7
Data: 104|UnityEngine.SerializeField, UnityEngine.CoreModule Data: 108|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -2040,13 +2137,13 @@ MonoBehaviour:
Data: tester Data: tester
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 105|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 109|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: tester Data: tester
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 106|System.RuntimeType, mscorlib Data: 110|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: NetworkManagerTester, Assembly-CSharp Data: NetworkManagerTester, Assembly-CSharp
@@ -2070,7 +2167,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 107|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], Data: 111|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib mscorlib
- Name: - Name:
Entry: 12 Entry: 12

View File

@@ -15,11 +15,8 @@ namespace Marro.PacManUdon
{ {
FullSyncForced = 0, FullSyncForced = 0,
FullSync = 1, FullSync = 1,
PacManTurn = 2, InputChange = 2,
StartGameButtonPressed = 3, StartGameButtonPressed = 3,
SyncPellets = 4,
GhostUpdate = 5,
TimeSequenceSync = 6,
Pause = 7, Pause = 7,
Resume = 8, Resume = 8,
Step = 9, Step = 9,
@@ -68,7 +65,7 @@ namespace Marro.PacManUdon
/// <summary> /// <summary>
/// The time delta at which updates occur. /// The time delta at which updates occur.
/// </summary> /// </summary>
[SerializeField] private float tickDelta = 0.0166666667f; [SerializeField] private float tickDelta = 0.0165f;
#endregion #endregion
#region Constants #region Constants
@@ -165,13 +162,21 @@ namespace Marro.PacManUdon
private bool serializationRequested; private bool serializationRequested;
/// <summary> /// <summary>
/// Events to send at the end of SyncedUpdate cycle /// Events to send at the end of SyncedUpdate cycle.
/// </summary> /// </summary>
private NetworkEventType[] eventsToSend; private NetworkEventType[] eventsToSendEarly;
/// <summary> /// <summary>
/// Index for <see cref="eventsToSend"/> /// Index for <see cref="eventsToSendEarly"/>.
/// </summary> /// </summary>
private int eventsToSendIndex; private int eventsToSendEarlyIndex;
/// <summary>
/// Events to send at the end of SyncedUpdate cycle, delayed by a tick.
/// </summary>
private NetworkEventType[] eventsToSendLate;
/// <summary>
/// Index for <see cref="eventsToSendLate"/>.
/// </summary>
private int eventsToSendLateIndex;
/// <summary> /// <summary>
/// Queue of events to be transmitted or processed. /// Queue of events to be transmitted or processed.
@@ -327,7 +332,7 @@ namespace Marro.PacManUdon
obj.networkManager = this; obj.networkManager = this;
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Found {syncedUpdateSubscribers.Length} {nameof(SyncedObject)} in children of {root.name}."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Found {syncedUpdateSubscribers.Length} {nameof(SyncedObject)} in children of {root.name}.");
const int eventTypeCount = byte.MaxValue + 1; const int eventTypeCount = byte.MaxValue + 1;
@@ -375,7 +380,7 @@ namespace Marro.PacManUdon
RequestEvent(NetworkEventType.FullSync); RequestEvent(NetworkEventType.FullSync);
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized");
} }
public void Update() public void Update()
@@ -409,7 +414,7 @@ namespace Marro.PacManUdon
ProcessEventsToSend(); // Prepare events from last cycle ProcessEventsToSend(); // Prepare events from last cycle
ProgressPingTime(); // See if we need to send a ping ProgressPingTime(); // See if we need to send a ping
} }
else if (!isOwner)
{ {
ApplyReceivedEvents(); // See if there's events after last update that need to be replayed ApplyReceivedEvents(); // See if there's events after last update that need to be replayed
} }
@@ -492,7 +497,7 @@ namespace Marro.PacManUdon
#endregion #endregion
#region Sender #region Sender
public void SendEventSoon(NetworkEventType eventType) public void SendEventSoon(NetworkEventType eventType, bool early = false)
{ {
if (!Ready) if (!Ready)
{ {
@@ -501,31 +506,52 @@ namespace Marro.PacManUdon
if (!IsOwner) if (!IsOwner)
{ {
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Attempted {nameof(SendEventSoon)} while not the owner!"); //Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Attempted {nameof(SendEventSoon)} while not the owner!");
return; return;
} }
if (eventsQueueIndex > eventsToSend.Length) if (early)
{ {
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSend)} overflow!"); if (eventsToSendEarlyIndex >= eventsToSendEarly.Length)
{
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSendEarly)} overflow!");
HandleError(false); HandleError(false);
return; return;
} }
eventsToSend[eventsToSendIndex++] = eventType; eventsToSendEarly[eventsToSendEarlyIndex++] = eventType;
}
else
{
if (eventsToSendLateIndex >= eventsToSendLate.Length)
{
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSendLate)} overflow!");
HandleError(false);
return;
}
eventsToSendLate[eventsToSendLateIndex++] = eventType;
}
} }
private void ProcessEventsToSend() private void ProcessEventsToSend()
{ {
for (int i = 0; i < eventsToSendIndex; i++) for (int i = 0; i < eventsToSendEarlyIndex; i++)
{ {
SendEventNow(eventsToSend[0]); SendEventNow(eventsToSendEarly[i], true);
} }
eventsToSendIndex = 0; eventsToSendEarlyIndex = 0;
for (int i = 0; i < eventsToSendLateIndex; i++)
{
SendEventNow(eventsToSendLate[i], false);
} }
public void SendEventNow(NetworkEventType eventType) eventsToSendLateIndex = 0;
}
public void SendEventNow(NetworkEventType eventType, bool early)
{ {
if (!Ready) if (!Ready)
{ {
@@ -540,17 +566,24 @@ namespace Marro.PacManUdon
var timestamp = SyncedTimeTicks; var timestamp = SyncedTimeTicks;
if (early)
{
timestamp--;
}
var eventId = GetNextEventId(lastEventId); var eventId = GetNextEventId(lastEventId);
InitializeEvent(eventType, timestamp, eventId, out byte[] data, out var index); InitializeEvent(eventType, timestamp, eventId, out byte[] data, out var index);
var subscibers = GetEventSubscribers(eventType); var effectiveEventType = eventType == NetworkEventType.FullSyncForced ? NetworkEventType.FullSync : eventType;
var subscibers = GetEventSubscribers(effectiveEventType);
if (subscibers != null) if (subscibers != null)
{ {
foreach (var obj in subscibers) foreach (var obj in subscibers)
{ {
obj.CollectSyncedData(data, ref index, eventType); obj.CollectSyncedData(data, ref index, effectiveEventType);
} }
} }
@@ -567,7 +600,7 @@ namespace Marro.PacManUdon
QueueEventInBuffer(data); QueueEventInBuffer(data);
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {data.Length} bytes, timestamp {timestamp} and id {eventId} for serialization."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {data.Length} bytes, timestamp {timestamp} and id {eventId} for serialization.");
RequestSerializationForEvents(); RequestSerializationForEvents();
@@ -647,7 +680,7 @@ namespace Marro.PacManUdon
serializationRequested = false; serializationRequested = false;
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serializing {eventsQueueIndex} event(s), eventTransmissionHistory is now {ArrayToString(eventTransmissionHistory)} with index {eventTransmissionHistoryIndex}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serializing {eventsQueueIndex} event(s), eventTransmissionHistory is now {ArrayToString(eventTransmissionHistory)} with index {eventTransmissionHistoryIndex}");
} }
public override void OnPostSerialization(SerializationResult result) => OnPostSerializationInternal(result.success, result.byteCount); public override void OnPostSerialization(SerializationResult result) => OnPostSerializationInternal(result.success, result.byteCount);
@@ -666,7 +699,7 @@ namespace Marro.PacManUdon
return; return;
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serialized with {networkedData.Length} bytes.\nBytes sent:\n{ArrayToString(networkedData)}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serialized with {networkedData.Length} bytes.\nBytes sent:\n{ArrayToString(networkedData)}");
// Remove data from the buffer that no longer needs to be (re)transmitted // Remove data from the buffer that no longer needs to be (re)transmitted
DequeueEventsFromBuffer(eventTransmissionHistory[eventTransmissionHistoryIndex]); DequeueEventsFromBuffer(eventTransmissionHistory[eventTransmissionHistoryIndex]);
@@ -711,7 +744,7 @@ namespace Marro.PacManUdon
return; // Nothing to store return; // Nothing to store
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Received {networkedData.Length} bytes!\nBytes received:\n{ArrayToString(networkedData)}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Received {networkedData.Length} bytes!\nBytes received:\n{ArrayToString(networkedData)}");
var length = networkedData.Length; var length = networkedData.Length;
int index = 0; int index = 0;
@@ -798,7 +831,7 @@ namespace Marro.PacManUdon
hasFullSyncReady = true; hasFullSyncReady = true;
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Queued full sync in buffer, should execute at {nextEventTime}."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Queued full sync in buffer, should execute at {nextEventTime}.");
} }
private void ApplyReceivedEvents() private void ApplyReceivedEvents()
@@ -838,19 +871,19 @@ namespace Marro.PacManUdon
return false; return false;
} }
if (eventType == NetworkEventType.FullSyncForced)
{
eventType = NetworkEventType.FullSync;
}
var index = (int)HeaderLength; // Skip header var index = (int)HeaderLength; // Skip header
var subscribers = GetEventSubscribers(eventType); var subscribers = GetEventSubscribers(eventType);
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) ApplyEvent with dt {SyncedDeltaTime}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) ApplyEvent with dt {SyncedDeltaTime}");
if (subscribers != null) if (subscribers != null)
{ {
foreach (var obj in subscribers)
{
obj.SyncedUpdate();
}
foreach (var obj in subscribers) foreach (var obj in subscribers)
{ {
var success = obj.WriteSyncedData(@event, ref index, eventType); var success = obj.WriteSyncedData(@event, ref index, eventType);
@@ -878,7 +911,7 @@ namespace Marro.PacManUdon
Synced = true; Synced = true;
} }
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes."); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes.");
retriesWithoutSuccess = 0; // We had success! retriesWithoutSuccess = 0; // We had success!
@@ -907,8 +940,11 @@ namespace Marro.PacManUdon
eventTransmissionHistory = new int[maxEventSendTries]; eventTransmissionHistory = new int[maxEventSendTries];
eventTransmissionHistoryIndex = 0; eventTransmissionHistoryIndex = 0;
eventsQueueIndexAtLastTransmission = 0; eventsQueueIndexAtLastTransmission = 0;
eventsToSend = new NetworkEventType[BufferMaxTotalEvents];
eventsToSendIndex = 0; eventsToSendEarly = new NetworkEventType[BufferMaxTotalEvents];
eventsToSendEarlyIndex = 0;
eventsToSendLate = new NetworkEventType[BufferMaxTotalEvents];
eventsToSendLateIndex = 0;
} }
private void DequeueEventsFromBuffer(int eventCount) private void DequeueEventsFromBuffer(int eventCount)
@@ -970,7 +1006,7 @@ namespace Marro.PacManUdon
SyncedTime = SyncedTimeTicks * tickDelta; SyncedTime = SyncedTimeTicks * tickDelta;
nextEventTime = timestamp; nextEventTime = timestamp;
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, internalTime is now {targetTicks}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}"); //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, internalTime is now {targetTicks}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}");
} }
private void UpdateNextEventTime() private void UpdateNextEventTime()
@@ -1103,11 +1139,6 @@ namespace Marro.PacManUdon
Array.Copy(data, start, result, 0, length); Array.Copy(data, start, result, 0, length);
return result; return result;
} }
private static float RoundDown(float value, float precision)
{
return (float)(Math.Floor(value / precision) * precision);
}
#endregion #endregion
#region SyncedData #region SyncedData
@@ -1197,22 +1228,7 @@ namespace Marro.PacManUdon
public void DoFullSync() public void DoFullSync()
{ {
SendEventSoon(NetworkEventType.FullSync); SendEventSoon(NetworkEventType.FullSyncForced);
}
public void DoPelletSync()
{
SendEventSoon(NetworkEventType.SyncPellets);
}
public void DoGhostSync()
{
SendEventSoon(NetworkEventType.GhostUpdate);
}
public void DoTimeSequenceSync()
{
SendEventSoon(NetworkEventType.TimeSequenceSync);
} }
public void Pause() public void Pause()

View File

@@ -109,31 +109,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: direction Data: position
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: direction Data: position
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 7|System.RuntimeType, mscorlib Data: 7|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.Direction, Assembly-CSharp Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 7 Entry: 9
Data: 8|System.RuntimeType, mscorlib Data: 7
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -148,7 +142,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -169,25 +163,31 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: directionVectors Data: direction
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: directionVectors Data: direction
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 11|System.RuntimeType, mscorlib Data: 10|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: UnityEngine.Vector2[], UnityEngine.CoreModule Data: Marro.PacManUdon.Direction, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 7
Data: 11 Data: 11|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -223,25 +223,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: gameManager Data: targetDirection
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: gameManager Data: targetDirection
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 14|System.RuntimeType, mscorlib Data: 10
- Name:
Entry: 1
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 4 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -256,7 +250,61 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
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: directionVectors
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: directionVectors
- Name: <UserType>k__BackingField
Entry: 7
Data: 16|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector2[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 16
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -280,13 +328,13 @@ MonoBehaviour:
Data: input Data: input
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: input Data: input
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 17|System.RuntimeType, mscorlib Data: 19|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.PlayerInput, Assembly-CSharp Data: Marro.PacManUdon.PlayerInput, Assembly-CSharp
@@ -310,7 +358,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -331,19 +379,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: pelletManager Data: collisionManager
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: pelletManager Data: collisionManager
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 20|System.RuntimeType, mscorlib Data: 22|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.PelletManager, Assembly-CSharp Data: Marro.PacManUdon.CollisionManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -364,7 +412,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -385,73 +433,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: defaultSpeed Data: animator
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: defaultSpeed Data: animator
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 23|System.RuntimeType, mscorlib Data: 25|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Single, mscorlib Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 23 Data: 25
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: powerPelletSpeed
- Name: $v
Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletSpeed
- Name: <UserType>k__BackingField
Entry: 9
Data: 23
- Name: <SystemType>k__BackingField
Entry: 9
Data: 23
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -487,19 +487,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: speed Data: renderer
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: speed Data: renderer
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 23 Data: 28|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Renderer, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 23 Data: 28
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -514,7 +520,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -538,22 +544,16 @@ MonoBehaviour:
Data: startPosition Data: startPosition
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: startPosition Data: startPosition
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 30|System.RuntimeType, mscorlib Data: 7
- Name:
Entry: 1
Data: UnityEngine.Vector3, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 30 Data: 7
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -589,19 +589,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: startRotation Data: defaultSpeed
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: startRotation Data: defaultSpeed
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 33|System.RuntimeType, mscorlib Data: 33|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: UnityEngine.Quaternion, UnityEngine.CoreModule Data: System.Single, mscorlib
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -643,25 +643,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: animator Data: powerPelletSpeed
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: animator Data: powerPelletSpeed
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 36|System.RuntimeType, mscorlib Data: 33
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 36 Data: 33
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -676,7 +670,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -697,25 +691,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: renderer Data: state
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: renderer Data: state
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 39|System.RuntimeType, mscorlib Data: 38|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: UnityEngine.Renderer, UnityEngine.CoreModule Data: Marro.PacManUdon.PacManState, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 39 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -730,7 +724,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -751,25 +745,67 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: hideUntilUnfrozen Data: speed
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: hideUntilUnfrozen Data: speed
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9
Data: 33
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
- Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: 42|System.RuntimeType, mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name: - Name:
Entry: 1 Entry: 6
Data: System.Boolean, mscorlib Data:
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 41|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: freezeSeconds
- Name: $v
Entry: 7
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: freezeSeconds
- Name: <UserType>k__BackingField
Entry: 9
Data: 33
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 42 Data: 33
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -805,19 +841,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: dead Data: frozen
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: dead Data: frozen
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 42 Data: 45|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 42 Data: 45
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -832,7 +874,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -856,16 +898,16 @@ MonoBehaviour:
Data: kinematic Data: kinematic
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: kinematic Data: kinematic
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 42 Data: 45
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 42 Data: 45
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -880,7 +922,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -904,16 +946,16 @@ MonoBehaviour:
Data: followingPredefinedPath Data: followingPredefinedPath
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: followingPredefinedPath Data: followingPredefinedPath
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 42 Data: 45
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 42 Data: 45
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -928,7 +970,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 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: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -952,13 +994,13 @@ MonoBehaviour:
Data: predefinedPath Data: predefinedPath
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: predefinedPath Data: predefinedPath
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 51|System.RuntimeType, mscorlib Data: 52|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.Direction[], Assembly-CSharp Data: Marro.PacManUdon.Direction[], Assembly-CSharp
@@ -967,7 +1009,7 @@ MonoBehaviour:
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 7 Entry: 7
Data: 52|System.RuntimeType, mscorlib Data: 53|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Int32[], mscorlib Data: System.Int32[], mscorlib
@@ -988,7 +1030,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 53|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1012,16 +1054,16 @@ MonoBehaviour:
Data: predefinedPathIndex Data: predefinedPathIndex
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: predefinedPathIndex Data: predefinedPathIndex
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 8 Data: 11
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 8 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1036,7 +1078,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1057,19 +1099,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: targetDirection Data: animatorKeyState
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: targetDirection Data: animatorKeyState
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 7 Data: 11
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 8 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1084,7 +1126,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1105,19 +1147,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: freezeSeconds Data: animatorKeyDirection
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: freezeSeconds Data: animatorKeyDirection
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 23 Data: 11
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 23 Data: 11
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1132,55 +1174,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 59|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
- 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: frozen
- Name: $v
Entry: 7
Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: frozen
- Name: <UserType>k__BackingField
Entry: 9
Data: 42
- Name: <SystemType>k__BackingField
Entry: 9
Data: 42
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0

View File

@@ -1,74 +1,75 @@
using System; using UnityEngine;
using UnityEngine;
namespace Marro.PacManUdon namespace Marro.PacManUdon
{ {
enum PacManAnimatorState
{
Idle,
Moving,
Stopped,
Big,
Dead,
}
enum PacManState
{
Idle,
Normal,
PowerPellet,
Dead,
Big,
}
[RequireComponent(typeof(Animator))] [RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Renderer))] [RequireComponent(typeof(Renderer))]
public class PacMan : GridMover public class PacMan : GridMover
{ {
private GameManager gameManager;
private PlayerInput input; private PlayerInput input;
private PelletManager pelletManager; private CollisionManager collisionManager;
private Animator animator;
private new Renderer renderer;
private Vector2 startPosition;
private float defaultSpeed; private float defaultSpeed;
private float powerPelletSpeed; private float powerPelletSpeed;
private PacManState state;
private float speed; private float speed;
private Vector3 startPosition; private float freezeSeconds;
private Quaternion startRotation; private bool frozen;
private Animator animator;
new Renderer renderer;
private bool hideUntilUnfrozen;
private bool dead;
private bool kinematic; private bool kinematic;
private bool followingPredefinedPath; private bool followingPredefinedPath;
private Direction[] predefinedPath; private Direction[] predefinedPath;
private int predefinedPathIndex; private int predefinedPathIndex;
private Direction targetDirection; private readonly int animatorKeyState = Animator.StringToHash("State");
private float freezeSeconds; private readonly int animatorKeyDirection = Animator.StringToHash("Direction");
private bool frozen;
#region Animator constants public void Initialize(PlayerInput input, Transform startTransform, GameManager gameManager, CollisionManager collisionManager)
private const string AnimatorKeyDead = "Dead";
private const string AnimatorKeyDirection = "Direction";
private const float AnimatorDirectionNone = 0f;
private const float AnimatorDirectionRight = 0.25f;
private const float AnimatorDirectionLeft = 0.50f;
private const float AnimatorDirectionDown = 0.75f;
private const float AnimatorDirectionUp = 1f;
private const float AnimatorDirectionRightBig = 1.25f;
#endregion
public void Initialize(PlayerInput input, Transform startTransform, GameManager gameManager, PelletManager pelletManager)
{ {
this.gameManager = gameManager; this.collisionManager = collisionManager;
this.pelletManager = pelletManager;
this.input = input; this.input = input;
animator = GetComponent<Animator>(); animator = GetComponent<Animator>();
renderer = GetComponent<Renderer>(); renderer = GetComponent<Renderer>();
frozen = false; frozen = false;
hideUntilUnfrozen = false;
startPosition = startTransform.localPosition; startPosition = startTransform.localPosition;
startRotation = startTransform.localRotation;
SubscribeToEvent(NetworkEventType.PacManTurn);
} }
public void Reset() public void Reset()
{ {
transform.SetLocalPositionAndRotation(startPosition, startRotation); SetPosition(startPosition);
direction = Direction.Left; direction = Direction.Left;
targetDirection = Direction.Left; targetDirection = Direction.Left;
speed = defaultSpeed;
kinematic = false; kinematic = false;
followingPredefinedPath = false; followingPredefinedPath = false;
SetDead(false); state = PacManState.Idle;
animator.SetTrigger("Reset");
//Debug.Log($"{gameObject} Reset! Position is now {GetPosition()}."); UpdateSpeed();
UpdateAnimator();
} }
public override void SyncedUpdate() public override void SyncedUpdate()
@@ -80,30 +81,7 @@ namespace Marro.PacManUdon
return; return;
} }
if (hideUntilUnfrozen) float speed = GetNextSpeed();
{
hideUntilUnfrozen = false;
SetVisibility(true);
}
float speed = this.speed;
if (freezeSeconds > 0)
{
float freezePart = freezeSeconds / networkManager.SyncedDeltaTime;
if (freezePart >= 1)
{
freezeSeconds -= networkManager.SyncedDeltaTime;
animator.speed = 0;
return;
}
speed *= 1 - freezePart;
animator.speed = 1 - freezePart;
freezeSeconds = 0;
}
else
{
animator.speed = 1;
}
Vector2 position = GetPosition(); Vector2 position = GetPosition();
Vector2 nextPosition = GetNextPosition(position, directionVectors[(int)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
@@ -128,10 +106,37 @@ namespace Marro.PacManUdon
SetPosition(nextPosition); SetPosition(nextPosition);
} }
private float GetNextSpeed()
{
float speed = this.speed;
if (freezeSeconds > 0)
{
float freezePart = freezeSeconds / networkManager.SyncedDeltaTime;
if (freezePart >= 1)
{
freezeSeconds -= networkManager.SyncedDeltaTime;
animator.speed = 0;
speed = 0;
}
else
{
speed *= 1 - freezePart;
animator.speed = 1 - freezePart;
freezeSeconds = 0;
}
}
else
{
animator.speed = 1;
}
return speed;
}
private Vector2 ProcessNextPosition(Vector2 position, Vector2 nextPosition) private Vector2 ProcessNextPosition(Vector2 position, Vector2 nextPosition)
{ {
if (CrossesTileCenter(position, nextPosition, Direction.Left) // If pacman is moving horizontally, check if he may cross the center of a tile in that axis if (CrossesTileCenter(position, nextPosition, Direction.Left) // If pacman is moving horizontally, check if he may cross the center of a tile in that axis
&& (!IsHorizontal(targetDirection) || pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)HorizontalComponent(direction)]))) && (!IsHorizontal(targetDirection) || collisionManager.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 { // If the target direction is in the other axis or if we're about to run into a wall
nextPosition.x = PositionToGrid(nextPosition).x; // Snap pacman to the center of his current tile in this axis nextPosition.x = PositionToGrid(nextPosition).x; // Snap pacman to the center of his current tile in this axis
SetDirection(VerticalComponent(direction)); SetDirection(VerticalComponent(direction));
@@ -139,7 +144,7 @@ namespace Marro.PacManUdon
} }
if (CrossesTileCenter(position, nextPosition, Direction.Down) // See comments above but now vertical if (CrossesTileCenter(position, nextPosition, Direction.Down) // See comments above but now vertical
&& (!IsVertical(targetDirection) || pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)VerticalComponent(direction)]))) && (!IsVertical(targetDirection) || collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)VerticalComponent(direction)])))
{ {
nextPosition.y = PositionToGrid(nextPosition).y; nextPosition.y = PositionToGrid(nextPosition).y;
SetDirection(HorizontalComponent(direction)); SetDirection(HorizontalComponent(direction));
@@ -148,7 +153,7 @@ namespace Marro.PacManUdon
var inputDirection = input.GetDirection(); var inputDirection = input.GetDirection();
if (!inputDirection.Equals(Direction.Zero) && !inputDirection.Equals(targetDirection) // Ignore neutral input or input in our current direction if (!inputDirection.Equals(Direction.Zero) && !inputDirection.Equals(targetDirection) // Ignore neutral input or input in our current direction
&& !pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)inputDirection])) // Check if the requested direction does not have a wall && !collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)inputDirection])) // Check if the requested direction does not have a wall
{ {
// Move in the requested direction, as well as perpundicular to it to get to the center of the tunnel // Move in the requested direction, as well as perpundicular to it to get to the center of the tunnel
if (IsHorizontal(inputDirection)) if (IsHorizontal(inputDirection))
@@ -162,11 +167,6 @@ namespace Marro.PacManUdon
SetDirection((Direction)((int)inputDirection | (int)directionToCenter)); SetDirection((Direction)((int)inputDirection | (int)directionToCenter));
} }
SetTargetDirection(inputDirection); // This is the direction most logic should assume pacman is moving, the actual direction may be different due to cornering SetTargetDirection(inputDirection); // This is the direction most logic should assume pacman is moving, the actual direction may be different due to cornering
if (!followingPredefinedPath)
{
networkManager.SendEventSoon(NetworkEventType.PacManTurn);
}
} }
return nextPosition; return nextPosition;
@@ -182,13 +182,12 @@ namespace Marro.PacManUdon
{ {
nextValidDirectionIndex += 1; nextValidDirectionIndex += 1;
} }
if (!pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)predefinedPath[nextValidDirectionIndex]])) if (!collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)predefinedPath[nextValidDirectionIndex]]))
{ {
// If we're at a Vector2.zero, we skip applying the direction and only increment. // If we're at a Vector2.zero, we skip applying the direction and only increment.
if (nextValidDirectionIndex == predefinedPathIndex) if (nextValidDirectionIndex == predefinedPathIndex)
{ {
SetDirection(predefinedPath[nextValidDirectionIndex]); SetDirectionAndTargetDirection(predefinedPath[nextValidDirectionIndex]);
SetTargetDirection(predefinedPath[nextValidDirectionIndex]);
nextPosition = PositionToGrid(nextPosition) + directionVectors[(int)direction] * 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 // Check if we've reached the end of the path, which includes making sure the path doesn't end on Vector2.zero
@@ -213,15 +212,15 @@ namespace Marro.PacManUdon
private void CheckNewTile(Vector2 position, Vector2 nextPosition) private void CheckNewTile(Vector2 position, Vector2 nextPosition)
{ {
var pellet = pelletManager.EatAtTile(position, nextPosition); var eatResult = collisionManager.PacManMoveToTile(position, nextPosition);
if (pellet == PelletType.Pellet) if (eatResult == EatResult.Pellet)
{ {
freezeSeconds = 0.0166666666666667f; freezeSeconds = 0.0165f;
} }
else if (pellet == PelletType.PowerPellet) else if (eatResult == EatResult.PowerPellet)
{ {
freezeSeconds = freezeSeconds = 0.05f; freezeSeconds = 0.0495f;
} }
} }
@@ -231,56 +230,58 @@ namespace Marro.PacManUdon
if (!gameObject.activeInHierarchy) if (!gameObject.activeInHierarchy)
return; return;
animator.SetBool(AnimatorKeyDead, dead); switch (state)
if (dead)
{ {
case PacManState.Dead:
SetAnimatorState((int)PacManAnimatorState.Dead);
animator.speed = 1;
return;
case PacManState.Idle:
SetAnimatorState((int)PacManAnimatorState.Idle);
return;
case PacManState.Big:
SetAnimatorState((int)PacManAnimatorState.Big);
animator.speed = 1; animator.speed = 1;
return; return;
} }
if (frozen || direction.Equals(Direction.Zero)) if (direction.Equals(Direction.Zero))
{ {
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionNone); SetAnimatorState((int)PacManAnimatorState.Stopped);
animator.speed = 0;
} }
else else
{ {
animator.speed = 1; SetAnimatorState((int)PacManAnimatorState.Moving);
if (targetDirection.Equals(Direction.Right))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionRight);
}
else if (targetDirection.Equals(Direction.Left))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionLeft);
}
else if (targetDirection.Equals(Direction.Down))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionDown);
}
else if (targetDirection.Equals(Direction.Up))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionUp);
}
}
} }
public void SetDead(bool dead) animator.speed = frozen ? 0 : 1;
SetAnimatorDirection((int)targetDirection);
}
private void SetAnimatorDirection(int value) =>
animator.SetFloat(animatorKeyDirection, value);
private void SetAnimatorState(int value) =>
animator.SetFloat(animatorKeyState, value);
public void Die()
{ {
this.dead = dead; state = PacManState.Dead;
UpdateAnimator(); UpdateAnimator();
} }
public void SetFrozen(bool frozen) public void SetFrozen(bool frozen)
{ {
this.frozen = frozen; this.frozen = frozen;
UpdateAnimator();
if (!frozen && state == PacManState.Idle)
{
state = PacManState.Normal;
} }
public void HideUntilUnfrozen() UpdateAnimator();
{
hideUntilUnfrozen = true;
SetVisibility(false);
} }
public void SetLevel(int level) public void SetLevel(int level)
@@ -288,11 +289,18 @@ namespace Marro.PacManUdon
// Debug.Log($"{gameObject} SetLevel {level}"); // Debug.Log($"{gameObject} SetLevel {level}");
defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level); defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level);
powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level); powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level);
UpdateSpeed();
} }
public void SetPowerPellet(bool powerPellet) public void SetPowerPellet(bool powerPellet)
{ {
if (powerPellet) state = powerPellet ? PacManState.PowerPellet : PacManState.Normal;
UpdateSpeed();
}
private void UpdateSpeed()
{
if (state == PacManState.PowerPellet)
{ {
speed = powerPelletSpeed; speed = powerPelletSpeed;
} }
@@ -326,54 +334,31 @@ namespace Marro.PacManUdon
public void BecomeBig() public void BecomeBig()
{ {
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionRightBig); state = PacManState.Big;
UpdateAnimator();
} }
void SetVisibility(bool visible) public void SetVisibility(bool visible)
{ {
renderer.enabled = visible; renderer.enabled = visible;
} }
public void SetTargetDirection(Direction targetDirection)
{
this.targetDirection = targetDirection;
UpdateAnimator();
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.PacManTurn) data.AppendAsByte((int)state, ref index);
{ data.Append(freezeSeconds, ref index);
return; data.Append(frozen, ref index);
}
if (kinematic || frozen || !enabled)
{
index += 1;
base.PadSyncedData(data, ref index, eventType);
return;
}
data.AppendAsByte((int)targetDirection, ref index);
base.CollectSyncedData(data, ref index, eventType); base.CollectSyncedData(data, ref index, eventType);
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
if (eventType != NetworkEventType.PacManTurn) state = (PacManState)data.ReadByte(ref index);
{ freezeSeconds = data.ReadFloat(ref index);
return true; frozen = data.ReadBool(ref index);
}
if (kinematic || frozen || !enabled) UpdateSpeed();
{
index += 1;
base.ConsumeSyncedData(data, ref index, eventType);
return true;
}
SetTargetDirection((Direction)data.ReadByte(ref index));
return base.WriteSyncedData(data, ref index, eventType); return base.WriteSyncedData(data, ref index, eventType);
} }

View File

@@ -69,37 +69,37 @@ namespace Marro.PacManUdon
// Jagged or 2D arrays can't be static so we work with 1D arrays // Jagged or 2D arrays can't be static so we work with 1D arrays
public static byte[] GetMazeCollisionInfo() => new byte[] public static byte[] GetMazeCollisionInfo() => new byte[]
{ {
192, 192, 192, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 192, 192, 192,
192, 192, 200, 010, 076, 076, 076, 076, 076, 076, 076, 076, 076, 076, 014, 076, 076, 014, 076, 076, 076, 076, 076, 076, 076, 076, 076, 076, 006, 196, 192, 192, 192, 192, 200, 009, 076, 076, 076, 076, 076, 076, 076, 076, 076, 076, 013, 076, 076, 013, 076, 076, 076, 076, 076, 076, 076, 076, 076, 076, 005, 196, 192, 192,
192, 192, 200, 067, 133, 193, 193, 193, 193, 193, 193, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 193, 193, 193, 193, 193, 193, 137, 067, 196, 192, 192, 192, 192, 200, 067, 134, 194, 194, 194, 194, 194, 194, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 194, 194, 194, 194, 194, 194, 138, 067, 196, 192, 192,
192, 192, 200, 067, 134, 194, 194, 194, 194, 192, 192, 194, 194, 138, 067, 196, 200, 067, 134, 194, 194, 192, 192, 194, 194, 194, 194, 138, 067, 196, 192, 192, 192, 192, 200, 067, 133, 193, 193, 193, 193, 192, 192, 193, 193, 137, 067, 196, 200, 067, 133, 193, 193, 192, 192, 193, 193, 193, 193, 137, 067, 196, 192, 192,
192, 192, 200, 009, 076, 014, 076, 076, 006, 196, 200, 010, 076, 076, 005, 196, 200, 009, 076, 076, 006, 196, 200, 010, 076, 076, 014, 076, 005, 196, 192, 192, 192, 192, 200, 010, 076, 013, 076, 076, 005, 196, 200, 009, 076, 076, 006, 196, 200, 010, 076, 076, 005, 196, 200, 009, 076, 076, 013, 076, 006, 196, 192, 192,
192, 192, 192, 193, 137, 067, 133, 137, 067, 196, 200, 067, 133, 193, 193, 192, 192, 193, 193, 137, 067, 196, 200, 067, 133, 137, 067, 133, 193, 192, 192, 192, 192, 192, 192, 194, 138, 067, 134, 138, 067, 196, 200, 067, 134, 194, 194, 192, 192, 194, 194, 138, 067, 196, 200, 067, 134, 138, 067, 134, 194, 192, 192, 192,
192, 192, 192, 194, 138, 067, 196, 200, 067, 134, 138, 067, 134, 194, 194, 194, 194, 194, 194, 138, 067, 134, 138, 067, 196, 200, 067, 134, 194, 192, 192, 192, 192, 192, 192, 193, 137, 067, 196, 200, 067, 133, 137, 067, 133, 193, 193, 193, 193, 193, 193, 137, 067, 133, 137, 067, 196, 200, 067, 133, 193, 192, 192, 192,
192, 192, 200, 010, 076, 005, 196, 200, 011, 076, 076, 013, 076, 076, 030, 076, 076, 030, 076, 076, 013, 076, 076, 007, 196, 200, 009, 076, 006, 196, 192, 192, 192, 192, 200, 009, 076, 006, 196, 200, 011, 076, 076, 014, 076, 076, 029, 076, 076, 029, 076, 076, 014, 076, 076, 007, 196, 200, 010, 076, 005, 196, 192, 192,
192, 192, 200, 067, 133, 193, 192, 200, 067, 133, 193, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 193, 137, 067, 196, 192, 193, 137, 067, 196, 192, 192, 192, 192, 200, 067, 134, 194, 192, 200, 067, 134, 194, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 194, 138, 067, 196, 192, 194, 138, 067, 196, 192, 192,
192, 192, 200, 067, 134, 194, 194, 138, 067, 134, 194, 194, 194, 138, 067, 196, 200, 067, 134, 194, 194, 194, 138, 067, 134, 194, 194, 138, 067, 196, 192, 192, 192, 192, 200, 067, 133, 193, 193, 137, 067, 133, 193, 193, 193, 137, 067, 196, 200, 067, 133, 193, 193, 193, 137, 067, 133, 193, 193, 137, 067, 196, 192, 192,
192, 192, 200, 009, 076, 076, 076, 076, 015, 076, 076, 014, 076, 076, 005, 196, 200, 009, 076, 076, 014, 076, 076, 015, 076, 076, 076, 076, 005, 196, 192, 192, 192, 192, 200, 010, 076, 076, 076, 076, 015, 076, 076, 013, 076, 076, 006, 196, 200, 010, 076, 076, 013, 076, 076, 015, 076, 076, 076, 076, 006, 196, 192, 192,
192, 192, 192, 193, 193, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 192, 192, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 193, 193, 192, 192, 192, 192, 192, 192, 194, 194, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 192, 192, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 194, 194, 192, 192, 192,
192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 067, 134, 194, 194, 194, 194, 194, 194, 138, 067, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 011, 076, 076, 076, 076, 076, 076, 076, 076, 007, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 067, 133, 193, 193, 193, 193, 193, 193, 137, 067, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 067, 133, 193, 193, 193, 193, 193, 193, 137, 067, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
194, 194, 194, 194, 194, 194, 194, 138, 067, 134, 138, 067, 196, 192, 192, 192, 192, 192, 192, 200, 067, 134, 138, 067, 134, 194, 194, 194, 194, 194, 194, 194, 192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 011, 076, 076, 076, 076, 076, 076, 076, 076, 007, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
108, 108, 108, 108, 108, 108, 108, 076, 015, 076, 076, 007, 196, 192, 192, 192, 192, 192, 192, 200, 011, 076, 076, 015, 076, 108, 108, 108, 108, 108, 108, 108,
193, 193, 193, 193, 193, 193, 193, 137, 067, 133, 137, 067, 196, 192, 192, 192, 192, 192, 192, 200, 067, 133, 137, 067, 133, 193, 193, 193, 193, 193, 193, 193,
192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 067, 134, 194, 194, 194, 194, 194, 194, 138, 067, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 067, 134, 194, 194, 194, 194, 194, 194, 138, 067, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 009, 076, 076, 030, 076, 076, 030, 076, 076, 005, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 193, 193, 193, 137, 067, 133, 137, 067, 196, 192, 192, 192, 192, 192, 192, 200, 067, 133, 137, 067, 133, 193, 193, 193, 193, 193, 193, 193,
192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 192, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 192, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192, 108, 108, 108, 108, 108, 108, 108, 076, 015, 076, 076, 007, 196, 192, 192, 192, 192, 192, 192, 200, 011, 076, 076, 015, 076, 108, 108, 108, 108, 108, 108, 108,
192, 192, 192, 194, 194, 194, 194, 138, 067, 196, 192, 194, 194, 138, 067, 196, 200, 067, 134, 194, 194, 192, 200, 067, 134, 194, 194, 194, 194, 192, 192, 192, 194, 194, 194, 194, 194, 194, 194, 138, 067, 134, 138, 067, 196, 192, 192, 192, 192, 192, 192, 200, 067, 134, 138, 067, 134, 194, 194, 194, 194, 194, 194, 194,
192, 192, 200, 010, 076, 076, 076, 076, 007, 196, 200, 010, 076, 076, 005, 196, 200, 009, 076, 076, 006, 196, 200, 011, 076, 076, 076, 076, 006, 196, 192, 192, 192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 067, 133, 193, 193, 193, 193, 193, 193, 137, 067, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
192, 192, 200, 067, 133, 193, 193, 137, 067, 196, 200, 067, 133, 193, 193, 192, 192, 193, 193, 137, 067, 196, 200, 067, 133, 193, 193, 137, 067, 196, 192, 192, 192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 200, 010, 076, 076, 029, 076, 076, 029, 076, 076, 006, 196, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
192, 192, 200, 067, 134, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 194, 194, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 138, 067, 196, 192, 192, 192, 192, 192, 192, 192, 192, 192, 200, 067, 196, 192, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 192, 200, 067, 196, 192, 192, 192, 192, 192, 192, 192,
192, 192, 200, 011, 076, 076, 076, 076, 015, 076, 076, 013, 076, 076, 014, 076, 076, 014, 076, 076, 013, 076, 076, 015, 076, 076, 076, 076, 007, 196, 192, 192, 192, 192, 192, 193, 193, 193, 193, 137, 067, 196, 192, 193, 193, 137, 067, 196, 200, 067, 133, 193, 193, 192, 200, 067, 133, 193, 193, 193, 193, 192, 192, 192,
192, 192, 200, 067, 133, 193, 193, 137, 067, 133, 193, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 193, 137, 067, 133, 193, 193, 137, 067, 196, 192, 192, 192, 192, 200, 009, 076, 076, 076, 076, 007, 196, 200, 009, 076, 076, 006, 196, 200, 010, 076, 076, 005, 196, 200, 011, 076, 076, 076, 076, 005, 196, 192, 192,
192, 192, 200, 067, 134, 194, 194, 138, 067, 196, 200, 067, 134, 194, 194, 192, 192, 194, 194, 138, 067, 196, 200, 067, 134, 194, 194, 138, 067, 196, 192, 192,
192, 192, 200, 067, 133, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 193, 193, 193, 193, 137, 067, 133, 137, 067, 133, 193, 193, 137, 067, 196, 192, 192,
192, 192, 200, 011, 076, 076, 076, 076, 015, 076, 076, 014, 076, 076, 013, 076, 076, 013, 076, 076, 014, 076, 076, 015, 076, 076, 076, 076, 007, 196, 192, 192,
192, 192, 200, 067, 134, 194, 194, 138, 067, 134, 194, 194, 194, 138, 067, 134, 138, 067, 134, 194, 194, 194, 138, 067, 134, 194, 194, 138, 067, 196, 192, 192,
192, 192, 200, 067, 196, 192, 192, 200, 067, 196, 192, 192, 192, 200, 067, 196, 200, 067, 196, 192, 192, 192, 200, 067, 196, 192, 192, 200, 067, 196, 192, 192, 192, 192, 200, 067, 196, 192, 192, 200, 067, 196, 192, 192, 192, 200, 067, 196, 200, 067, 196, 192, 192, 192, 200, 067, 196, 192, 192, 200, 067, 196, 192, 192,
192, 192, 200, 067, 134, 194, 194, 138, 067, 134, 194, 194, 194, 138, 067, 196, 200, 067, 134, 194, 194, 194, 138, 067, 134, 194, 194, 138, 067, 196, 192, 192, 192, 192, 200, 067, 133, 193, 193, 137, 067, 133, 193, 193, 193, 137, 067, 196, 200, 067, 133, 193, 193, 193, 137, 067, 133, 193, 193, 137, 067, 196, 192, 192,
192, 192, 200, 009, 076, 076, 076, 076, 013, 076, 076, 076, 076, 076, 005, 196, 200, 009, 076, 076, 076, 076, 076, 013, 076, 076, 076, 076, 005, 196, 192, 192, 192, 192, 200, 010, 076, 076, 076, 076, 014, 076, 076, 076, 076, 076, 006, 196, 200, 010, 076, 076, 076, 076, 076, 014, 076, 076, 076, 076, 006, 196, 192, 192,
192, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 192, 192, 192, 192, 192, 192, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 192, 192, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 192, 192, 192,
192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192,
}; };

View File

@@ -43,31 +43,37 @@ MonoBehaviour:
Data: Data:
- Name: - Name:
Entry: 12 Entry: 12
Data: 8 Data: 10
- Name: - Name:
Entry: 7 Entry: 7
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: active Data: networkManager
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: active Data: networkManager
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 3|System.RuntimeType, mscorlib Data: 3|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Boolean, mscorlib Data: Marro.PacManUdon.NetworkManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 7
Data: 3 Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -82,7 +88,7 @@ MonoBehaviour:
Data: true Data: true
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -103,31 +109,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: gameManager Data: active
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: gameManager Data: active
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7
Data: 6|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7 Entry: 7
Data: 7|System.RuntimeType, mscorlib Data: 7|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon Data: System.Boolean, mscorlib
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -139,7 +139,7 @@ MonoBehaviour:
Data: Data:
- Name: <IsSerialized>k__BackingField - Name: <IsSerialized>k__BackingField
Entry: 5 Entry: 5
Data: false Data: true
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
@@ -163,31 +163,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: inputHorizontal Data: gameManager
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: inputHorizontal Data: gameManager
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 10|System.RuntimeType, mscorlib Data: 10|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.Direction, Assembly-CSharp Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 7 Entry: 9
Data: 11|System.RuntimeType, mscorlib Data: 4
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -202,7 +196,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -223,19 +217,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: inputVertical Data: player
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: inputVertical Data: player
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 10 Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 11 Data: 13
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -271,25 +271,31 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: horizontalValue Data: inputMethod
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: horizontalValue Data: inputMethod
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 16|System.RuntimeType, mscorlib Data: 16|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: System.Single, mscorlib Data: Marro.PacManUdon.InputMethod, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 7
Data: 16 Data: 17|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -304,7 +310,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -325,67 +331,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: verticalValue Data: resultInput
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: verticalValue Data: resultInput
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 16 Data: 20|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Direction, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 16 Data: 17
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: horizontalPriority
- Name: $v
Entry: 7
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: horizontalPriority
- Name: <UserType>k__BackingField
Entry: 9
Data: 3
- Name: <SystemType>k__BackingField
Entry: 9
Data: 3
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -421,19 +385,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: player Data: analogInput
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: player Data: analogInput
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 23|System.RuntimeType, mscorlib Data: 23|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
@@ -470,6 +434,156 @@ MonoBehaviour:
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: dirty
- Name: $v
Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: dirty
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 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: lastUsedHand
- Name: $v
Entry: 7
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: lastUsedHand
- Name: <UserType>k__BackingField
Entry: 7
Data: 28|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.Common.HandType, VRC.Udon.Common
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 28
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: horizontalPriority
- Name: $v
Entry: 7
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: horizontalPriority
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name: - Name:
Entry: 13 Entry: 13
Data: Data:

View File

@@ -1,29 +1,80 @@
namespace Marro.PacManUdon namespace Marro.PacManUdon
{ {
using System; using System;
using UdonSharp;
using UnityEngine; using UnityEngine;
using VRC.SDKBase; using VRC.SDKBase;
using VRC.Udon.Common; using VRC.Udon.Common;
public class PlayerInput : UdonSharpBehaviour enum InputMethod
{
KeyboardMouse,
Other,
}
public class PlayerInput : SyncedObject
{ {
public bool active; public bool active;
private GameManager gameManager; private GameManager gameManager;
Direction inputHorizontal;
Direction inputVertical; private VRCPlayerApi player;
float horizontalValue; private InputMethod inputMethod;
float verticalValue;
bool horizontalPriority; private Direction resultInput;
VRCPlayerApi player; private Vector2 analogInput;
private bool dirty;
private HandType lastUsedHand;
private bool horizontalPriority;
public void Initialize(GameManager gameManager) public void Initialize(GameManager gameManager)
{ {
this.gameManager = gameManager; this.gameManager = gameManager;
inputHorizontal = Direction.Zero;
inputVertical = Direction.Zero;
horizontalPriority = false;
player = Networking.LocalPlayer; player = Networking.LocalPlayer;
inputMethod = InputMethod.KeyboardMouse;
resultInput = Direction.Zero;
analogInput = Vector2.zero;
dirty = false;
horizontalPriority = false;
SubscribeToEvent(NetworkEventType.InputChange);
}
void Update()
{
if (active)
{
if (Input.GetKeyDown(KeyCode.R))
{
gameManager.ResetButtonPressed();
}
if (Input.GetKeyDown(KeyCode.G))
{
gameManager.networkManager.DoFullSync();
}
if (Input.GetKeyDown(KeyCode.C))
{
gameManager.JumpToTimeSequenceBoardClear();
}
}
else
{
if (Input.GetKeyDown(KeyCode.T))
{
gameManager.ResetButtonPressed();
}
}
}
public override void SyncedUpdate()
{
if (dirty) // Update now to ensure input feedback is performed timely
{
UpdateResultInput();
}
} }
public void Activate() public void Activate()
@@ -67,30 +118,10 @@
{ {
return; return;
} }
horizontalValue = Math.Abs(value);
if (value < -0.5)
{
inputHorizontal = Direction.Left;
if (horizontalValue >= verticalValue)
{
SetPriority(true);
}
}
else if (value > 0.5)
{
inputHorizontal = Direction.Right;
if (horizontalValue >= verticalValue)
{
SetPriority(true);
}
}
else
{
inputHorizontal = Direction.Zero;
SetPriority(false);
}
// Debug.Log("Horizontal Input Event: " + value + " | Direction: " + direction + " | lastDirection: " + lastDirection + " | Left: " + left + " | Right: " + right); analogInput.x = value;
lastUsedHand = args.handType;
dirty = true;
} }
public override void InputMoveVertical(float value, UdonInputEventArgs args) public override void InputMoveVertical(float value, UdonInputEventArgs args)
@@ -99,51 +130,145 @@
{ {
return; return;
} }
verticalValue = Math.Abs(value);
if (value < -0.5) analogInput.y = value;
{ lastUsedHand = args.handType;
inputVertical = Direction.Up; dirty = true;
if (verticalValue >= horizontalValue)
{
SetPriority(false);
}
}
else if (value > 0.5)
{
inputVertical = Direction.Down;
if (verticalValue >= horizontalValue)
{
SetPriority(false);
}
}
else
{
inputVertical = Direction.Zero;
SetPriority(true);
} }
// Debug.Log("Vertical Input Event: " + value + " | Direction: " + direction + " | lastDirection : " + lastDirection); public override void OnInputMethodChanged(VRCInputMethod inputMethod)
{
switch (inputMethod)
{
case VRCInputMethod.Keyboard:
case VRCInputMethod.Mouse:
this.inputMethod = InputMethod.KeyboardMouse;
return;
default:
this.inputMethod = InputMethod.Other;
return;
}
} }
private void SetPriority(bool horizontalPriority) private void UpdateResultInput()
{ {
if (this.horizontalPriority != horizontalPriority) dirty = false;
var newResult = GetResultInput(analogInput);
if (newResult == resultInput)
{ {
player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75); return;
this.horizontalPriority = horizontalPriority;
} }
//Debug.Log($"Switched to input direction {newResult} from analogInput {analogInput} with HorizontalPriority {horizontalPriority}");
resultInput = newResult;
networkManager.SendEventSoon(NetworkEventType.InputChange, true);
PlayHaptics();
}
private void PlayHaptics()
{
if (inputMethod == InputMethod.KeyboardMouse)
{
return;
}
VRC_Pickup.PickupHand hand;
switch (lastUsedHand)
{
case HandType.LEFT:
hand = VRC_Pickup.PickupHand.Left;
break;
case HandType.RIGHT:
hand = VRC_Pickup.PickupHand.Right;
break;
default:
return;
}
player.PlayHapticEventInHand(hand, 0.1f, 0.15f, 75);
}
private Direction GetResultInput(Vector2 analogInput)
{
if (analogInput.magnitude < 0.8)
{
return Direction.Zero;
}
var normalized = analogInput.normalized;
//Debug.Log($"Checking analogInput {analogInput} with HorizontalPriority {horizontalPriority}, normalized {normalized}");
const float directionDivider = 0.72f;
if (normalized.x > directionDivider)
{
horizontalPriority = false;
return Direction.Right;
}
else if (normalized.x < -directionDivider)
{
horizontalPriority = false;
return Direction.Left;
}
else if (normalized.y > directionDivider)
{
horizontalPriority = true;
return Direction.Up;
}
else if (normalized.y < -directionDivider)
{
horizontalPriority = true;
return Direction.Down;
}
if (horizontalPriority)
{
if (normalized.x > 0)
{
return Direction.Right;
}
return Direction.Left;
}
if (normalized.y > 0)
{
return Direction.Up;
}
return Direction.Down;
} }
public Direction GetDirection() public Direction GetDirection()
{ {
if (horizontalPriority) if (dirty) // Update now to reduce input delay
{ {
return inputHorizontal; UpdateResultInput();
} }
else
return resultInput;
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
return inputVertical; if (eventType != NetworkEventType.InputChange)
} {
return;
}
ByteUtils.AppendAsByte(data, (int)resultInput, ref index);
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.InputChange)
{
return true;
}
resultInput = (Direction)ByteUtils.ReadByte(data, ref index);
return true;
} }
} }
} }

View File

@@ -1,52 +0,0 @@
%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: PowerPellet
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: bc9582994932aa648bc02c914215e7cc, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 55d0efe8af4dba540a508287baca6656, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 7835090324168685075
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:

View File

@@ -1,12 +0,0 @@
namespace Marro.PacManUdon
{
using UdonSharp;
public class PowerPellet : UdonSharpBehaviour
{
// Oh how I wish I could just have this method extend pellet and do things the normal way...
// But alas, with 'typeof', 'is' and overriding base fields all broken/not available I don't see a good way of differentiating between a type or its derivatives...
// The only reason I even want to use this class is so I can do GetComponentsInChildren<PowerPellet> instead of gathering all Pellets and then sorting through them.
// But since power pellets are the only pellets with animators, I'll probably just use GetComponentsInChildren<Animator> instead without further checking, since the animator is what I need to manipulate anyway.
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 55d0efe8af4dba540a508287baca6656
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -14,7 +14,6 @@ namespace Marro.PacManUdon
SetGameState(PacManGameState.AttractModeDemo); SetGameState(PacManGameState.AttractModeDemo);
break; break;
case 1: case 1:
InitializeLevel();
SetMazeVisible(true); SetMazeVisible(true);
SetLevel(1); SetLevel(1);
break; break;
@@ -323,7 +322,6 @@ namespace Marro.PacManUdon
break; break;
case 3: case 3:
SetPelletsActive(true); SetPelletsActive(true);
pelletManager.RestoreAllPellets();
statusDisplay.SetGameOverTextVisible(true); statusDisplay.SetGameOverTextVisible(true);
break; break;
case 4: case 4:

View File

@@ -16,7 +16,7 @@ namespace Marro.PacManUdon
// Initialize // Initialize
soundManager.SuppressSound(true); soundManager.SuppressSound(true);
attractScreen.gameObject.SetActive(true); attractScreen.gameObject.SetActive(true);
attractScreen.Initialize(this, bonusFruit); attractScreen.Initialize(this, bonusFruit, ghostManager.Ghosts);
for (int i = 0; i <= 15; i++) for (int i = 0; i <= 15; i++)
{ {
// Debug.Log($"{gameObject} TimeSequenceAttractScreen deactivating with iteration i"); // Debug.Log($"{gameObject} TimeSequenceAttractScreen deactivating with iteration i");
@@ -92,7 +92,6 @@ namespace Marro.PacManUdon
pacMan.SetPosition(attractScreenElements[16].transform.localPosition); pacMan.SetPosition(attractScreenElements[16].transform.localPosition);
pacMan.SetDirection(Direction.Left); pacMan.SetDirection(Direction.Left);
ghostManager.RestartLevel();
ghostManager.SetLevel(2); ghostManager.SetLevel(2);
ghostManager.SetKinematic(true); ghostManager.SetKinematic(true);
ghostManager.SetActive(true); ghostManager.SetActive(true);
@@ -100,7 +99,7 @@ namespace Marro.PacManUdon
for (int i = 0; i < ghosts.Length; i++) for (int i = 0; i < ghosts.Length; i++)
{ {
ghosts[i].SetPosition(attractScreenElements[17 + i].transform.localPosition); ghosts[i].SetPosition(attractScreenElements[17 + i].transform.localPosition);
ghosts[i].SetDirection(Direction.Left); ghosts[i].SetDirectionAndTargetDirection(Direction.Left);
ghosts[i].SetState(PacManGhostState.Normal); ghosts[i].SetState(PacManGhostState.Normal);
} }
break; break;
@@ -119,8 +118,7 @@ namespace Marro.PacManUdon
case 18: case 18:
// Turn PacMan around after eating power pellet // Turn PacMan around after eating power pellet
pacMan.SetDirection(Direction.Right); pacMan.SetDirectionAndTargetDirection(Direction.Right);
pacMan.SetTargetDirection(Direction.Right);
break; break;
case 19: case 19:

View File

@@ -9,7 +9,7 @@ namespace Marro.PacManUdon
case 0: case 0:
// Show game over text, freeze power pellet blink // Show game over text, freeze power pellet blink
statusDisplay.SetGameOverTextVisible(true); statusDisplay.SetGameOverTextVisible(true);
pelletManager.FreezePowerPelletsBlink(true); collisionManager.FreezePowerPelletsBlink(true);
break; break;
case 1: case 1:
break; break;

View File

@@ -21,8 +21,7 @@ namespace Marro.PacManUdon
{ {
// Unfreeze and reveal pacman // Unfreeze and reveal pacman
SetPacManActive(true); SetPacManActive(true);
SetFrozen(false); SetFrozen(false); // This also makes the caught ghost return home
ghostManager.GhostCaughtContinue();
soundManager.SetGhostRetreat(true); soundManager.SetGhostRetreat(true);
} }
} }

View File

@@ -26,14 +26,14 @@ namespace Marro.PacManUdon
pacMan.SetKinematic(true); pacMan.SetKinematic(true);
pacMan.SetActive(true); pacMan.SetActive(true);
pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition); pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition);
pacMan.SetDirection(Direction.Left); pacMan.SetDirectionAndTargetDirection(Direction.Left);
ghostManager.SetLevel(5); ghostManager.SetLevel(5);
ghostManager.SetKinematic(true); ghostManager.SetKinematic(true);
ghostManager.gameObject.SetActive(true); ghostManager.gameObject.SetActive(true);
blinky.SetElroy(2); blinky.SetElroy(2);
blinky.SetPosition(intermissionScreenElements[1].transform.localPosition); blinky.SetPosition(intermissionScreenElements[1].transform.localPosition);
blinky.SetDirection(Direction.Left); blinky.SetDirectionAndTargetDirection(Direction.Left);
blinky.SetState(PacManGhostState.Normal); blinky.SetState(PacManGhostState.Normal);
SetFrozen(false); SetFrozen(false);
@@ -53,7 +53,7 @@ namespace Marro.PacManUdon
break; break;
case 4: case 4:
// Pacman starts chasing ghosts // Pacman starts chasing ghosts
pacMan.SetDirection(Direction.Right); pacMan.SetDirectionAndTargetDirection(Direction.Right);
pacMan.BecomeBig(); pacMan.BecomeBig();
break; break;
case 5: case 5:

View File

@@ -34,14 +34,14 @@ namespace Marro.PacManUdon
pacMan.SetKinematic(true); pacMan.SetKinematic(true);
pacMan.SetActive(true); pacMan.SetActive(true);
pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition); pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition);
pacMan.SetDirection(Direction.Left); pacMan.SetDirectionAndTargetDirection(Direction.Left);
ghostManager.SetLevel(5); ghostManager.SetLevel(5);
ghostManager.SetKinematic(true); ghostManager.SetKinematic(true);
ghostManager.gameObject.SetActive(true); ghostManager.gameObject.SetActive(true);
blinky.SetElroy(2); blinky.SetElroy(2);
blinky.SetPosition(intermissionScreenElements[1].transform.localPosition); blinky.SetPosition(intermissionScreenElements[1].transform.localPosition);
blinky.SetDirection(Direction.Left); blinky.SetDirectionAndTargetDirection(Direction.Left);
blinky.SetState(PacManGhostState.Normal); blinky.SetState(PacManGhostState.Normal);
SetFrozen(false); SetFrozen(false);
@@ -65,16 +65,16 @@ namespace Marro.PacManUdon
case 8: case 8:
// Blinky sprite updates with broken cover // Blinky sprite updates with broken cover
blinky.SetSpecialLook(true); blinky.SetSpecialLook(true);
blinky.SetDirection(Direction.Up); blinky.SetDirectionAndTargetDirection(Direction.Up);
blinky.SetPosition(blinky.GetPosition() + new Vector2(-0.250f, 0f)); blinky.SetPosition(blinky.GetPosition() + new Vector2(-0.250f, 0f));
break; break;
case 9: case 9:
// Blinky looks at broken cover // Blinky looks at broken cover
blinky.SetDirection(Direction.Down); blinky.SetDirectionAndTargetDirection(Direction.Down);
break; break;
case 10: case 10:
// Cutscene starts to unload // Cutscene starts to unload
blinky.SetDirection(Direction.Zero); blinky.SetDirectionAndTargetDirection(Direction.Zero);
break; break;
case 11: case 11:
// End cutscene // End cutscene

View File

@@ -26,14 +26,14 @@ namespace Marro.PacManUdon
pacMan.SetKinematic(true); pacMan.SetKinematic(true);
pacMan.SetActive(true); pacMan.SetActive(true);
pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition); pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition);
pacMan.SetDirection(Direction.Left); pacMan.SetDirectionAndTargetDirection(Direction.Left);
ghostManager.SetLevel(5); ghostManager.SetLevel(5);
ghostManager.SetKinematic(true); ghostManager.SetKinematic(true);
ghostManager.gameObject.SetActive(true); ghostManager.gameObject.SetActive(true);
blinky.SetElroy(2); blinky.SetElroy(2);
blinky.SetPosition(intermissionScreenElements[1].transform.localPosition); blinky.SetPosition(intermissionScreenElements[1].transform.localPosition);
blinky.SetDirection(Direction.Left); blinky.SetDirectionAndTargetDirection(Direction.Left);
blinky.SetState(PacManGhostState.Normal); blinky.SetState(PacManGhostState.Normal);
blinky.SetSpecialLook(true); blinky.SetSpecialLook(true);
@@ -45,13 +45,13 @@ namespace Marro.PacManUdon
break; break;
case 3: case 3:
// Reached end, freeze // Reached end, freeze
pacMan.SetDirection(Direction.Zero); pacMan.SetDirectionAndTargetDirection(Direction.Zero);
blinky.SetDirection(Direction.Zero); blinky.SetDirectionAndTargetDirection(Direction.Zero);
break; break;
case 4: case 4:
// Ghost runs back on screen // Ghost runs back on screen
blinky.SetPosition(intermissionScreenElements[3].transform.localPosition); blinky.SetPosition(intermissionScreenElements[3].transform.localPosition);
blinky.SetDirection(Direction.Right); blinky.SetDirectionAndTargetDirection(Direction.Right);
break; break;
case 5: case 5:
// End cutscene // End cutscene

View File

@@ -14,7 +14,7 @@ namespace Marro.PacManUdon
case 1: case 1:
// Hide ghosts, start pacman death animation // Hide ghosts, start pacman death animation
SetGhostsActive(false); SetGhostsActive(false);
pacMan.SetDead(true); pacMan.Die();
break; break;
case 2: case 2:
// Start playing death sound // Start playing death sound

View File

@@ -42,7 +42,6 @@ namespace Marro.PacManUdon
SetFrozen(false); SetFrozen(false);
soundManager.SuppressSound(false); soundManager.SuppressSound(false);
soundManager.StartGhostSound(); soundManager.StartGhostSound();
soundManager.UpdatePelletCount(pelletManager.PelletCount - pelletManager.PelletCollectedCount);
} }
} }
} }

View File

@@ -11,7 +11,6 @@ namespace Marro.PacManUdon
gameState = PacManGameState.InGame; gameState = PacManGameState.InGame;
InitializeNewGame(); InitializeNewGame();
InitializeLevel();
PrepareForCutscene(); PrepareForCutscene();
soundManager.SuppressSound(false); soundManager.SuppressSound(false);

View File

@@ -10,9 +10,9 @@ namespace Marro.PacManUdon
PrepareForCutscene(); PrepareForCutscene();
// Reset, show maze and score display // Reset, show maze and score display
InitializeLevel();
SetMazeVisible(true); SetMazeVisible(true);
statusDisplay.SetScoreDisplayVisible(true); statusDisplay.SetScoreDisplayVisible(true);
statusDisplay.SetLabel1UPTextBlinking(true);
break; break;
case 1: case 1:
// Increment level, show ready, show pellets, show lives indicators // Increment level, show ready, show pellets, show lives indicators

View File

@@ -5,9 +5,8 @@ namespace Marro.PacManUdon
public partial class GameManager public partial class GameManager
{ {
// A note about the quality of the code here: // A note about the quality of the code here:
// I intended to write this using proper classes, right until I realized Udon does not support instantiating classes. // I intended to write this using separate classes per time sequence, until I realized Udon does not support instantiating classes.
// While I'm not a big fan of the partial class solution that I ended up doing (static classes would still be neater, or perhaps separate UdonSharpBehaviour instances), // While I'm not a big fan of using partial classes for this, I'm not redoing this unless there's a major Udon update before I wrap up this project.
// I'm not redoing this unless I get instantiatable classes before I wrap up this project.
bool currentlyInTimeSequence; bool currentlyInTimeSequence;
bool waitingForTimeSequenceFinalize; bool waitingForTimeSequenceFinalize;
bool jumpingToTimeSequence; bool jumpingToTimeSequence;
@@ -44,7 +43,6 @@ namespace Marro.PacManUdon
jumpingToTimeSequence = true; jumpingToTimeSequence = true;
TimeSequenceProgressToTime(100000f); TimeSequenceProgressToTime(100000f);
if (waitingForTimeSequenceFinalize) if (waitingForTimeSequenceFinalize)
{ {
TimeSequenceExecuteFinalize(currentTimeSequence); TimeSequenceExecuteFinalize(currentTimeSequence);
@@ -97,29 +95,29 @@ namespace Marro.PacManUdon
private void TimeSequenceFinish(PacManTimeSequence timeSequence) private void TimeSequenceFinish(PacManTimeSequence timeSequence)
{ {
TimeSequenceExecuteFinalize(timeSequence); TimeSequenceExecuteFinalize(timeSequence);
networkManager.SendEventSoon(NetworkEventType.TimeSequenceSync);
if (!jumpingToTimeSequence) if (!jumpingToTimeSequence)
{ {
TimeSequenceExecuteFinished(timeSequence); TimeSequenceExecuteFinished(timeSequence);
} }
} }
private void TimeSequenceSyncWithRemote(PacManTimeSequence currentTimeSequence, float timeSequenceSecondsPassed) private void TimeSequenceSyncWithRemote(PacManTimeSequence remoteCurrentTimeSequence, float timeSequenceSecondsPassedRemote)
{ {
// If the remote is in a time sequence but we're not, or we're in a different time sequence, or if we're behind, // If our current time sequence state is incompatible with the remote time sequence, kill it
// jump to the remote's time sequence. if (currentlyInTimeSequence && remoteCurrentTimeSequence != currentTimeSequence
if (!currentlyInTimeSequence || timeSequenceSecondsPassedRemote < timeSequenceSecondsPassed)
|| currentTimeSequence != this.currentTimeSequence
|| timeSequenceSecondsPassed < this.timeSequenceSecondsPassed)
{ {
StartTimeSequence(currentTimeSequence); currentlyInTimeSequence = false;
} }
// If we're (now) in a time sequence, jump our progress to match the one on the remote // If we're not/no longer in a time sequence, start the remote's time sequence
if (currentlyInTimeSequence) if (!currentlyInTimeSequence)
{ {
TimeSequenceProgressToTime(timeSequenceSecondsPassed); StartTimeSequence(remoteCurrentTimeSequence);
} }
// Jump our progress to match the one on the remote
TimeSequenceProgressToTime(timeSequenceSecondsPassedRemote);
} }
#region Events #region Events

View File

@@ -1147,19 +1147,25 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: _nextDotSound Data: alternatePelletSound
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: _nextDotSound Data: alternatePelletSound
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 7
Data: 17 Data: 66|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 17 Data: 66
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1174,7 +1180,7 @@ MonoBehaviour:
Data: false Data: false
- Name: _fieldAttributes - Name: _fieldAttributes
Entry: 7 Entry: 7
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name: - Name:
Entry: 12 Entry: 12
Data: 0 Data: 0
@@ -1195,25 +1201,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: _ghostRetreating Data: ghostRetreating
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: _ghostRetreating Data: ghostRetreating
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 9
Data: 68|System.RuntimeType, mscorlib Data: 66
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 68 Data: 66
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1249,19 +1249,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: _ghostBlue Data: ghostBlue
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: _ghostBlue Data: ghostBlue
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 68 Data: 66
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 68 Data: 66
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1297,13 +1297,13 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: _ghostSoundLevel Data: ghostSoundLevel
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: _ghostSoundLevel Data: ghostSoundLevel
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 7 Entry: 7
Data: 73|System.RuntimeType, mscorlib Data: 73|System.RuntimeType, mscorlib
@@ -1351,19 +1351,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: _currentlyPlayingSiren Data: currentlyPlayingSiren
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: _currentlyPlayingSiren Data: currentlyPlayingSiren
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 68 Data: 66
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 68 Data: 66
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1399,19 +1399,19 @@ MonoBehaviour:
Data: Data:
- Name: $k - Name: $k
Entry: 1 Entry: 1
Data: _suppress Data: suppress
- Name: $v - Name: $v
Entry: 7 Entry: 7
Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField - Name: <Name>k__BackingField
Entry: 1 Entry: 1
Data: _suppress Data: suppress
- Name: <UserType>k__BackingField - Name: <UserType>k__BackingField
Entry: 9 Entry: 9
Data: 68 Data: 66
- Name: <SystemType>k__BackingField - Name: <SystemType>k__BackingField
Entry: 9 Entry: 9
Data: 68 Data: 66
- Name: <SyncMode>k__BackingField - Name: <SyncMode>k__BackingField
Entry: 7 Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib

View File

@@ -1,9 +1,7 @@
using JetBrains.Annotations;
using Marro.PacManUdon; using Marro.PacManUdon;
using UdonSharp;
using UnityEngine; using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class SoundManager : SyncedObject public class SoundManager : SyncedObject
{ {
@@ -30,13 +28,13 @@ public class SoundManager : SyncedObject
[SerializeField] private AudioClip siren3; [SerializeField] private AudioClip siren3;
[SerializeField] private AudioClip siren4; [SerializeField] private AudioClip siren4;
private AudioClip _nextDotSound; private bool alternatePelletSound;
private bool _ghostRetreating; private bool ghostRetreating;
private bool _ghostBlue; private bool ghostBlue;
private int _ghostSoundLevel; private int ghostSoundLevel;
private bool _currentlyPlayingSiren; private bool currentlyPlayingSiren;
private bool _suppress; private bool suppress;
public void Initialize() public void Initialize()
{ {
@@ -47,19 +45,19 @@ public class SoundManager : SyncedObject
{ {
StopAllSound(); StopAllSound();
_nextDotSound = pacDot2; alternatePelletSound = false;
_ghostRetreating = false; ghostRetreating = false;
_ghostBlue = false; ghostBlue = false;
_ghostSoundLevel = 0; ghostSoundLevel = 0;
_currentlyPlayingSiren = false; currentlyPlayingSiren = false;
_suppress = true; suppress = true;
} }
public void SuppressSound(bool suppress) public void SuppressSound(bool suppress)
{ {
_suppress = suppress; this.suppress = suppress;
if (suppress) if (suppress)
{ {
@@ -79,8 +77,8 @@ public class SoundManager : SyncedObject
public void PlayPelletSound() public void PlayPelletSound()
{ {
PlaySound(audioSourcePacMan, _nextDotSound); PlaySound(audioSourcePacMan, alternatePelletSound ? pacDot2 : pacDot1);
_nextDotSound = _nextDotSound == pacDot1 ? pacDot2 : pacDot1; alternatePelletSound = !alternatePelletSound;
} }
public void PlayDeathSound() public void PlayDeathSound()
@@ -115,13 +113,13 @@ public class SoundManager : SyncedObject
public void SetGhostBlue(bool isBlue) public void SetGhostBlue(bool isBlue)
{ {
_ghostBlue = isBlue; ghostBlue = isBlue;
UpdateGhostSound(); UpdateGhostSound();
} }
public void SetGhostRetreat(bool isRetreating) public void SetGhostRetreat(bool isRetreating)
{ {
_ghostRetreating = isRetreating; ghostRetreating = isRetreating;
UpdateGhostSound(); UpdateGhostSound();
} }
@@ -154,19 +152,19 @@ public class SoundManager : SyncedObject
// Debug.Log($"UpdatePelletCount: {pelletCount}, level: {level}"); // Debug.Log($"UpdatePelletCount: {pelletCount}, level: {level}");
if (_ghostSoundLevel >= level) if (ghostSoundLevel >= level)
{ {
return; return;
} }
_ghostSoundLevel = level; ghostSoundLevel = level;
UpdateGhostSound(); UpdateGhostSound();
} }
private void PlaySound(AudioSource audioSource, AudioClip audioClip, bool loop = false) private void PlaySound(AudioSource audioSource, AudioClip audioClip, bool loop = false)
{ {
// Debug.Log($"PlaySound, audioSource: {audioSource}, audioClip: {audioClip}, loop: {loop}, suppress: {_suppress}"); // Debug.Log($"PlaySound, audioSource: {audioSource}, audioClip: {audioClip}, loop: {loop}, suppress: {_suppress}");
if (_suppress) if (suppress)
{ {
return; return;
} }
@@ -184,7 +182,7 @@ public class SoundManager : SyncedObject
private void SwitchSound(AudioSource audioSource, AudioClip audioClip, bool loop) private void SwitchSound(AudioSource audioSource, AudioClip audioClip, bool loop)
{ {
if (_suppress) if (suppress)
{ {
return; return;
} }
@@ -210,22 +208,22 @@ public class SoundManager : SyncedObject
private void UpdateGhostSound() private void UpdateGhostSound()
{ {
if (_ghostRetreating) if (ghostRetreating)
{ {
PlaySound(audioSourceGhosts, pacGhostRetreat, true); PlaySound(audioSourceGhosts, pacGhostRetreat, true);
_currentlyPlayingSiren = false; currentlyPlayingSiren = false;
return; return;
} }
if (_ghostBlue) if (ghostBlue)
{ {
PlaySound(audioSourceGhosts, pacGhostBlue, true); PlaySound(audioSourceGhosts, pacGhostBlue, true);
_currentlyPlayingSiren = false; currentlyPlayingSiren = false;
return; return;
} }
var currentGhostLevelSound = GetSoundForGhostLevel(_ghostSoundLevel); var currentGhostLevelSound = GetSoundForGhostLevel(ghostSoundLevel);
if (_currentlyPlayingSiren) if (currentlyPlayingSiren)
{ {
SwitchSound(audioSourceGhosts, currentGhostLevelSound, true); SwitchSound(audioSourceGhosts, currentGhostLevelSound, true);
} }
@@ -234,7 +232,7 @@ public class SoundManager : SyncedObject
PlaySound(audioSourceGhosts, currentGhostLevelSound, true); PlaySound(audioSourceGhosts, currentGhostLevelSound, true);
} }
_currentlyPlayingSiren = true; currentlyPlayingSiren = true;
} }
private AudioClip GetSoundForGhostLevel(int ghostLevel) private AudioClip GetSoundForGhostLevel(int ghostLevel)
@@ -256,11 +254,23 @@ public class SoundManager : SyncedObject
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
data.Append(alternatePelletSound, ref index);
data.Append(ghostRetreating, ref index);
data.Append(ghostBlue, ref index);
data.AppendAsByte(ghostSoundLevel, ref index);
data.Append(currentlyPlayingSiren, ref index);
} }
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{ {
alternatePelletSound = data.ReadBool(ref index);
ghostRetreating = data.ReadBool(ref index);
ghostBlue = data.ReadBool(ref index);
ghostSoundLevel = data.ReadByte(ref index);
currentlyPlayingSiren = data.ReadBool(ref index);
UpdateGhostSound();
return true; return true;
} }
} }

View File

@@ -166,15 +166,5 @@ namespace Marro.PacManUdon
levelDisplayDigitAnimators[i].SetFloat("FruitType", PacManConstants.FruitTypeToValue(PacManConstants.GetFruitTypeForLevel(level - i))); levelDisplayDigitAnimators[i].SetFloat("FruitType", PacManConstants.FruitTypeToValue(PacManConstants.GetFruitTypeForLevel(level - i)));
} }
} }
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
return true;
}
} }
} }

View File

@@ -1,6 +1,4 @@
using System.Collections; using UdonSharp;
using UdonSharp;
using UnityEngine;
namespace Marro.PacManUdon namespace Marro.PacManUdon
{ {

View File

@@ -1,178 +0,0 @@
%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: Teleporter
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 1589eb7cce8925e4da3272208dfa87f4, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: aae1c5d18ae01b3488b54c72e6f1edf6, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -7788394196284941649
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: 2
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: direction
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: direction
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Direction, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 6|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: target
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: target
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Transform, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 10|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: 13
Data:
- Name:
Entry: 8
Data:

View File

@@ -1,23 +0,0 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
public class Teleporter : UdonSharpBehaviour
{
[SerializeField] private Direction direction = Direction.Zero;
[SerializeField] private Transform target;
void OnTriggerEnter(Collider other)
{
GridMover gridMover = other.gameObject.GetComponent<GridMover>();
if (gridMover == null || gridMover.GetDirection() != direction)
{
return;
}
gridMover.SetPosition(gridMover.GetPosition() + (Vector2)(target.localPosition - transform.localPosition));
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: aae1c5d18ae01b3488b54c72e6f1edf6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,14 +0,0 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
public class Test : UdonSharpBehaviour
{
[SerializeField] Pellet pellet;
public void Start()
{
Debug.Log(pellet.enabled);
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0227a738d77ab0849bdc9047b5b27c78
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,118 +0,0 @@
%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: Test1
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 6457f9f1332ac0742bdff23291631f30, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 0227a738d77ab0849bdc9047b5b27c78, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -4571266787425106669
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: 1
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: pellet
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pellet
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Pellet, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 6|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: 13
Data:
- Name:
Entry: 8
Data:

View File

@@ -1,65 +0,0 @@
// // Silly me for wanting to make the code neat, forgot this was Udon :)
// using System.Collections;
// using System.Collections.Generic;
// using UdonSharp;
// using UnityEngine;
// public abstract class TimeSequence : UdonSharpBehaviour
// {
// [UdonSynced] float secondsPassed;
// int sequenceProgress;
// float[] sequenceTimeSeconds;
// protected TimeSequence(float[] sequenceTimeSeconds)
// {
// sequenceProgress = 0;
// secondsPassed = 0;
// this.sequenceTimeSeconds = sequenceTimeSeconds;
// ProgressSequenceToTime(secondsPassed);
// }
// public void ProgressInTime(float deltaSeconds)
// {
// ProgressSequenceToTime(secondsPassed + deltaSeconds);
// }
// public void ProgressSequenceToTime(float seconds)
// {
// secondsPassed = seconds;
// while (secondsPassed >= sequenceTimeSeconds[sequenceProgress])
// {
// sequenceProgress += 1;
// SequenceStep(sequenceProgress);
// }
// }
// protected abstract void SequenceStep(int sequneceProgress);
// public static float[] DeltaToAbsolute(float[] delta)
// {
// if (delta.Length < 1)
// {
// return new float[0];
// }
// float[] absolute = new float[delta.Length];
// absolute[0] = delta[0];
// for (int i = 1; i < delta.Length; i++)
// {
// absolute[i] = delta[i] + absolute[i-1];
// }
// return absolute;
// }
// public int SequenceProgress
// {
// get => sequenceProgress;
// }
// public float SecondsPassed
// {
// get => secondsPassed;
// set => ProgressSequenceToTime(value);
// }
// }

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 789dbd838d9dd5645852b3bda8c5a161
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -121,7 +121,7 @@ MonoBehaviour:
Data: 7|System.RuntimeType, mscorlib Data: 7|System.RuntimeType, mscorlib
- Name: - Name:
Entry: 1 Entry: 1
Data: Marro.PacManUdon.PelletManager, Assembly-CSharp Data: Marro.PacManUdon.CollisionManager, Assembly-CSharp
- Name: - Name:
Entry: 8 Entry: 8
Data: Data:

View File

@@ -18,7 +18,7 @@ namespace Marro.PacManUdon.Dev
public class MazeDefinitionGenerator : UdonSharpBehaviour public class MazeDefinitionGenerator : UdonSharpBehaviour
{ {
public BonusFruit bonusFruit; public BonusFruit bonusFruit;
public PelletManager pelletManager; public CollisionManager pelletManager;
const int width = 32; const int width = 32;
const int height = 32; const int height = 32;
@@ -59,13 +59,13 @@ namespace Marro.PacManUdon.Dev
private void WriteBonusFruitTiles(int[] map) private void WriteBonusFruitTiles(int[] map)
{ {
var position = GridMover.PositionToGrid(new Vector2(bonusFruit.transform.localPosition.x, bonusFruit.transform.localPosition.y)); var position = GridMover.PositionToGrid(new Vector2(bonusFruit.transform.localPosition.x, bonusFruit.transform.localPosition.y));
var leftTileIndex = PelletManager.GetTilemapIndex(position); var leftTileIndex = CollisionManager.GetTilemapIndex(position);
map[leftTileIndex] = (int)PacManConsumableType.FruitLeft; map[leftTileIndex] = (int)PacManConsumableType.FruitLeft;
var rightTileIndex = leftTileIndex - 1; var rightTileIndex = leftTileIndex - 1;
map[rightTileIndex] = (int)PacManConsumableType.FruitRight; map[rightTileIndex] = (int)PacManConsumableType.FruitRight;
} }
private void PrintMazeMap() private static void PrintMazeMap()
{ {
int[] map = new int[width * height]; int[] map = new int[width * height];
var collisionMap = GetCollisionMap(); var collisionMap = GetCollisionMap();
@@ -73,7 +73,7 @@ namespace Marro.PacManUdon.Dev
for (int i = 0; i < map.Length; i++) for (int i = 0; i < map.Length; i++)
{ {
byte result = 0; byte result = 0;
var tile = collisionMap[i]; var tile = GetTileAtIndex(collisionMap, i);
if (tile == (byte)CollisionMap.Wall) if (tile == (byte)CollisionMap.Wall)
{ {
@@ -92,34 +92,34 @@ namespace Marro.PacManUdon.Dev
result |= GetGhostTurnInformation(collisionMap, i, width, height); result |= GetGhostTurnInformation(collisionMap, i, width, height);
map[(i % width) + (height - i / width - 1) * width] = result; map[i] = result;
} }
PrintMap(map, width); PrintMap(map, width);
} }
private byte GetGhostTurnInformation(byte[] collisionMap, int i, int width, int height) private static byte GetGhostTurnInformation(byte[] collisionMap, int i, int width, int height)
{ {
byte result = 0; byte result = 0;
var totalAvailableDirections = 0; var totalAvailableDirections = 0;
if (collisionMap[GetTilemapIndex(i, Vector2.up, width, height)] != (byte)CollisionMap.Wall) if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.up, width, height)) != (byte)CollisionMap.Wall)
{ {
result |= 0b0001; result |= (byte)Direction.Up;
totalAvailableDirections += 1; totalAvailableDirections += 1;
} }
if (collisionMap[GetTilemapIndex(i, Vector2.down, width, height)] != (byte)CollisionMap.Wall) if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.down, width, height)) != (byte)CollisionMap.Wall)
{ {
result |= 0b0010; result |= (byte)Direction.Down;
totalAvailableDirections += 1; totalAvailableDirections += 1;
} }
if (collisionMap[GetTilemapIndex(i, Vector2.left, width, height)] != (byte)CollisionMap.Wall) if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.left, width, height)) != (byte)CollisionMap.Wall)
{ {
result |= 0b0100; result |= (byte)Direction.Left;
totalAvailableDirections += 1; totalAvailableDirections += 1;
} }
if (collisionMap[GetTilemapIndex(i, Vector2.right, width, height)] != (byte)CollisionMap.Wall) if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.right, width, height)) != (byte)CollisionMap.Wall)
{ {
result |= 0b1000; result |= (byte)Direction.Right;
totalAvailableDirections += 1; totalAvailableDirections += 1;
} }
@@ -132,39 +132,14 @@ namespace Marro.PacManUdon.Dev
return result; return result;
} }
private int GetTilemapIndex(int index, Vector2 direction, int width, int height) private static int GetTilemapIndex(int index, Vector2 direction, int width, int height)
{ {
var position = new Vector2(index % width, index / width) + direction; var position = new Vector2(index % width, index / width) + direction;
position = Clamp(position, 0, width - 1, 0, height - 1); var result = ((int)position.x + width) % width + ((int)position.y + height) % height * width;
var result = (int)position.x + (int)position.y * width;
return result; return result;
} }
private static Vector2 Clamp(Vector2 vector, float xMin, float xMax, float yMin, float yMax) private static void PrintMap(int[] map, int width)
{
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;
}
private void PrintMap(int[] map, int width)
{ {
var result = ""; var result = "";
for (int i = 0; i < map.Length; i++) for (int i = 0; i < map.Length; i++)
@@ -187,6 +162,10 @@ namespace Marro.PacManUdon.Dev
Debug.Log(result); Debug.Log(result);
} }
private static byte GetTileAtIndex(byte[] map, int index) => map[GetUpsideDownIndex(index)];
private static int GetUpsideDownIndex(int index) => (index % width) + (height - index / width - 1) * width;
public static byte[] GetCollisionMap() => new byte[] { public static byte[] GetCollisionMap() => new byte[] {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

View File

@@ -46,11 +46,11 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
DiscardCapture(); DiscardCapture();
} }
Debug.Log($"ownerTime: {ownerTime}, remoteTime: {remoteTime}, ownerIndex: {ownerIndex} ({captureTimes[ownerIndex]}), remoteIndex: {remoteIndex} ({captureTimes[remoteIndex]})"); //Debug.Log($"ownerTime: {ownerTime}, remoteTime: {remoteTime}, ownerIndex: {ownerIndex} ({captureTimes[ownerIndex]}), remoteIndex: {remoteIndex} ({captureTimes[remoteIndex]})");
if (captureTimes[remoteIndex] == remoteTime) if (captureTimes[remoteIndex] == remoteTime)
{ {
bool equal = IsEqual(remoteIndex); bool equal = IsEqual(remoteIndex, remoteTime);
SetIndicator(equal); SetIndicator(equal);
DiscardCapture(); DiscardCapture();
@@ -63,7 +63,7 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
IncrementIndex(ref remoteIndex); IncrementIndex(ref remoteIndex);
} }
private bool IsEqual(int index) private bool IsEqual(int index, int time)
{ {
var equal = true; var equal = true;
@@ -79,7 +79,7 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
if (gridMover1Position != gridMover2Position) if (gridMover1Position != gridMover2Position)
{ {
Debug.LogWarning($"{nameof(NetworkManagerSyncTester)} Desync found:\n{gridMover1.name} {gridMover1Position} != {gridMover2.name} {gridMover2Position}"); Debug.LogWarning($"{nameof(NetworkManagerSyncTester)} Desync found at {time} in {gridMover1.name}:\n {gridMover1Position} (local) != {gridMover2Position} (remote)");
//networkManager1.Pause(); //networkManager1.Pause();
//networkManager2.Pause(); //networkManager2.Pause();
equal = false; equal = false;

View File

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

View File

@@ -50,7 +50,7 @@ public class TestBallManager : UdonSharpBehaviour
testBall.UpButtonPressed(); testBall.UpButtonPressed();
} }
networkManager.SendEventSoon(NetworkEventType.PacManTurn); networkManager.SendEventSoon(NetworkEventType.InputChange);
} }
public void SyncButtonPressed() public void SyncButtonPressed()