Compare commits

..

23 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
52 changed files with 3948 additions and 4251 deletions

View File

@@ -4023,7 +4023,7 @@ MonoBehaviour:
pacMan: {fileID: 7714172614521704433}
ghostManager: {fileID: 86024623784576607}
bonusFruit: {fileID: 9157969083631739240}
pelletManager: {fileID: 5525660384197170489}
collisionManager: {fileID: 5525660384197170489}
statusDisplay: {fileID: 2491098304099187056}
attractScreen: {fileID: 775310085919228412}
intermissionScreen: {fileID: 5421513610437161912}
@@ -7208,8 +7208,8 @@ Transform:
m_GameObject: {fileID: 3147892916020834424}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -21.5, y: -0.5, z: 0}
m_LocalScale: {x: 3, y: 1, z: 1}
m_LocalPosition: {x: -16.5, y: -0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3555002988650332767}
@@ -9785,7 +9785,7 @@ MonoBehaviour:
_udonSharpBackingUdonBehaviour: {fileID: 1180286844452673728}
networkManager: {fileID: 0}
root: {fileID: 6505452106475299050}
delay: 50
delay: 1
maxEventSendTries: 3
pingDelay: 15
tickDelta: 0.016666668
@@ -10013,8 +10013,8 @@ Transform:
m_GameObject: {fileID: 4219034801460140058}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 21.5, y: -0.5, z: -0}
m_LocalScale: {x: 3, y: 1, z: 1}
m_LocalPosition: {x: 16.5, y: -0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3555002988650332767}
@@ -13286,8 +13286,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6046534300734189827}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 6.63, z: -17.23}
m_LocalRotation: {x: 0.707061, y: -0, z: -0, w: 0.70715266}
m_LocalPosition: {x: 0.91, y: 6.63, z: -17.23}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -13298,7 +13298,7 @@ Transform:
- {fileID: 7739671690796916192}
- {fileID: 8246186970405181641}
m_Father: {fileID: 4412758497759775873}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &6154585327471317047
GameObject:
m_ObjectHideFlags: 0
@@ -17723,7 +17723,7 @@ MonoBehaviour:
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: Intermission3
m_StringArgument: JumpToTimeSequenceIntermission3
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &8473082740403796940
@@ -18064,7 +18064,6 @@ Transform:
- {fileID: 4974322025078650459}
- {fileID: 8663222629720968739}
- {fileID: 5905242471040052083}
- {fileID: 7572300588514824209}
- {fileID: 1307805930192074193}
- {fileID: 8119785692059435336}
- {fileID: 862107006485386518}
@@ -21302,7 +21301,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 27754be47f0109d4ebd0238a3abcab08, type: 2}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_Enabled
@@ -21342,7 +21341,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_LocalPosition.z
@@ -35338,7 +35337,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: d77dfda7d2b90ea4983b8659e2c6c0e9, type: 2}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: _syncMethod
@@ -35374,7 +35373,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_LocalPosition.z
@@ -38846,7 +38845,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 60dca779cada8784ab66dba8be5a3187, type: 2}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: _syncMethod
@@ -38882,7 +38881,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5838653651634851978, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6697301723706685617, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_LocalPosition.z
@@ -44975,6 +44974,10 @@ PrefabInstance:
propertyPath: m_Name
value: Pellet
objectReference: {fileID: 0}
- target: {fileID: 7512162431685415002, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: pelletRenderer
value:
objectReference: {fileID: 6717290563504616900}
- target: {fileID: 7512162431685415002, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -44993,6 +44996,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
m_PrefabInstance: {fileID: 5788101997426616030}
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
PrefabInstance:
m_ObjectHideFlags: 0
@@ -56274,7 +56282,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1872706630021487550, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2436955608773050784, guid: 5cb7233bb90971d45b4f876816f8ca1e, type: 3}
propertyPath: _syncMethod
@@ -56292,6 +56300,10 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
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}
propertyPath: gameStateManager
value:
@@ -58768,76 +58780,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
m_PrefabInstance: {fileID: 8822547946008480523}
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
PrefabInstance:
m_ObjectHideFlags: 0

View File

@@ -266,6 +266,7 @@ MonoBehaviour:
networkManager: {fileID: 0}
ghostType: 3
startState: 0
targetIndicator: {fileID: 5838653651634851978}
--- !u!212 &4205939556154507887
SpriteRenderer:
m_ObjectHideFlags: 0

View File

@@ -458,7 +458,9 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 962437701}
- {fileID: 1772674898}
m_Father: {fileID: 1886023632}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &107806787
@@ -1024,17 +1026,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 109330399196804403, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!114 &217059831 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7704679238063621622, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 217059824}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &219051897 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7293350050207545893, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -1136,12 +1127,12 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 234876908}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4.266148, y: 14.909718, z: -30.038902}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 806746267}
m_Father: {fileID: 712073434}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &236177420 stripped
GameObject:
@@ -1624,6 +1615,37 @@ Transform:
m_Children: []
m_Father: {fileID: 712073434}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &342215208
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 342215209}
m_Layer: 0
m_Name: CRT effect
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &342215209
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 342215208}
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: 2142346958}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &352364310 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2068762643646008789, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -3088,6 +3110,37 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 5828188922401714812, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
--- !u!1 &568397006
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 568397007}
m_Layer: 0
m_Name: Game invisible outside of screen
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &568397007
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 568397006}
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: 2142346958}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &569194355
GameObject:
m_ObjectHideFlags: 0
@@ -3119,6 +3172,37 @@ Transform:
m_Children: []
m_Father: {fileID: 712073434}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &571802606
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 571802607}
m_Layer: 0
m_Name: High score persistance
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &571802607
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 571802606}
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: 851913432}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &573616886 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 184438965336248073, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -3476,11 +3560,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 3863977511622223325, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!1 &648473600 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4879515261813748277, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!1 &649385175 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3556558624868497024, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -3807,6 +3886,7 @@ Transform:
- {fileID: 393606783}
- {fileID: 675058737}
- {fileID: 20511504}
- {fileID: 234876909}
m_Father: {fileID: 1886023632}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &712508021 stripped
@@ -4015,7 +4095,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &805005471
Transform:
m_ObjectHideFlags: 0
@@ -4133,23 +4213,46 @@ MonoBehaviour:
networkManager1: {fileID: 811840793}
gridMovers1:
- {fileID: 63452443}
- {fileID: 1237257558}
- {fileID: 1910438138}
- {fileID: 1407423087}
- {fileID: 1541737191}
networkManager2: {fileID: 65516626}
gridMovers2:
- {fileID: 1366842346}
- {fileID: 1766929461}
- {fileID: 217059831}
- {fileID: 1205077370}
- {fileID: 1411581077}
debugImageToIndicateSynced: {fileID: 483106229}
--- !u!1 &805185634 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1928664601999823222, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
--- !u!1 &806335367
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 806335368}
m_Layer: 0
m_Name: Instance high score
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &806335368
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 806335367}
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: 851913432}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &806693070 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4795217970421011192, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -4187,13 +4290,11 @@ Transform:
- {fileID: 1131865220}
- {fileID: 1266097396}
- {fileID: 1501975777}
- {fileID: 234876909}
- {fileID: 2005036258}
- {fileID: 1835410441}
- {fileID: 2091228438}
- {fileID: 606557185}
- {fileID: 1101037633}
- {fileID: 2057945690}
- {fileID: 1033118942}
- {fileID: 196434888}
- {fileID: 1933482823}
@@ -4367,7 +4468,9 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 571802607}
- {fileID: 806335368}
m_Father: {fileID: 1886023632}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &859475370 stripped
@@ -4512,6 +4615,37 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 8648916981024671211, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!1 &962437700
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 962437701}
m_Layer: 0
m_Name: Repair demo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &962437701
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 962437700}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 106401850}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &962831748 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4432432907462793590, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -5858,11 +5992,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 7543685317323407149, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
--- !u!212 &1157790591 stripped
SpriteRenderer:
m_CorrespondingSourceObject: {fileID: 6717290563504616900, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1161575203
GameObject:
m_ObjectHideFlags: 0
@@ -6223,17 +6352,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 3694438210017678001, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1205077370 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6353919794372223604, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1205077363}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1210508488
PrefabInstance:
m_ObjectHideFlags: 0
@@ -6684,7 +6802,19 @@ PrefabInstance:
objectReference: {fileID: 3521573303519548534, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.x
value: -0.2
value: 0.74
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.x
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 90
objectReference: {fileID: 0}
- target: {fileID: 3559251034056489513, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
@@ -7088,7 +7218,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6505452106475299050, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6516549313887553636, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
@@ -7455,7 +7585,25 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 644674727704841727, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
insertIndex: 6
addedObject: {fileID: 483106233}
m_AddedComponents: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 760989357904163835, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
- targetCorrespondingSourceObject: {fileID: 2210743849556565093, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
- targetCorrespondingSourceObject: {fileID: 1499136851737879348, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
- targetCorrespondingSourceObject: {fileID: 1730673936899394188, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
- targetCorrespondingSourceObject: {fileID: 1930333237022248453, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
- targetCorrespondingSourceObject: {fileID: 7219308242589081280, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
m_SourcePrefab: {fileID: 100100000, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
--- !u!1 &1214273987 stripped
GameObject:
@@ -7508,17 +7656,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 3576665465728788261, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1237257558 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2281557418868999653, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 384558790}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1245947246 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6377306495378490162, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -7993,17 +8130,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 3694438210017678001, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1407423087 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6353919794372223604, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1407423078}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1408697865 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6617131549196965745, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -8029,17 +8155,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 4054778616656183051, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1411581077 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5993614020202909646, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1411581070}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1418273771 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 531603117301386236, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -8192,6 +8307,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1470248941}
- {fileID: 991830906}
- {fileID: 791132292}
- {fileID: 2130594149}
@@ -8420,6 +8536,37 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1465823362}
m_CullTransparentMesh: 1
--- !u!1 &1470248940
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1470248941}
m_Layer: 0
m_Name: Check if ghost behaviour per level is correct
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1470248941
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1470248940}
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: 1438618203}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1472000832 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6334235783093999612, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -8758,17 +8905,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 355077758653607555, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1541737191 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5993614020202909646, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 262522556}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1551317024 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3556558624868497024, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -11023,10 +11159,6 @@ MonoBehaviour:
ID: 367
SerializedTypeNames:
- VRC.Udon.UdonBehaviour
- gameObject: {fileID: 648473600}
ID: 368
SerializedTypeNames:
- VRC.Udon.UdonBehaviour
- gameObject: {fileID: 1377949919}
ID: 369
SerializedTypeNames:
@@ -12052,17 +12184,37 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 8413102315728467232, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1766929461 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2281557418868999653, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
--- !u!1 &1772674897
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1766929454}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
serializedVersion: 6
m_Component:
- component: {fileID: 1772674898}
m_Layer: 0
m_Name: Repair other cutscenes
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1772674898
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1772674897}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 106401850}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1773753006 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7955628641985366373, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -12529,17 +12681,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 8799161989223030618, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1910438138 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7704679238063621622, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 7528894854307259292}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1592985534}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1916414808 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3975383514799343505, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
@@ -13555,37 +13696,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 1601034992910289008, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_PrefabInstance: {fileID: 1210508488}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2057945689
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2057945690}
m_Layer: 0
m_Name: Move sequences out of GameController
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2057945690
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2057945689}
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: 806746267}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2058746900
GameObject:
m_ObjectHideFlags: 0
@@ -14023,6 +14133,8 @@ Transform:
m_Children:
- {fileID: 2140840173}
- {fileID: 1133488565}
- {fileID: 342215209}
- {fileID: 568397007}
m_Father: {fileID: 1886023632}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2145578061 stripped
@@ -14155,10 +14267,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 776794315963647603, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 795751881681854794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: delay
value: 1
objectReference: {fileID: 0}
- target: {fileID: 795751881681854794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14187,14 +14295,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 924272570997129752, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 938860582923239144, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: direction
value: 8
objectReference: {fileID: 0}
- target: {fileID: 938860582923239144, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 938860582923239144, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 1008641616848376944, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14235,10 +14335,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 1310392953743924049, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 1375004589053852572, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 1375004589053852572, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 1533136797888595341, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14247,14 +14343,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 1576847302585915034, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 1669426961422516371, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: direction
value: 4
objectReference: {fileID: 0}
- target: {fileID: 1669426961422516371, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 1669426961422516371, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 1696930345459662827, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14323,10 +14411,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 2105085335797955363, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 2122160117470481098, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2135826314059557985, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14395,10 +14479,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 2632463664781619728, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 2644300872115716338, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2829790701909084540, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14411,10 +14491,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 2928564681495186498, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 2956202255016695448, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 2956202255016695448, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 3080353369963190003, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14435,18 +14511,10 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 3112141267984921751, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 3147892916020834424, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3166429239840473342, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 3166429239840473342, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 3178542716354759352, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: JumpToTimeSequenceIntermission3
objectReference: {fileID: 0}
- target: {fileID: 3180767675366436896, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14475,10 +14543,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 3374507140697445330, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 3436881978671590728, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3453674652927074866, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14505,27 +14569,7 @@ PrefabInstance:
objectReference: {fileID: 3521573303519548534, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.x
value: 0.91
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.w
value: 0.70715266
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.x
value: 0.707061
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3555002988650332767, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 90
value: -0.1
objectReference: {fileID: 0}
- target: {fileID: 3559251034056489513, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
@@ -14571,10 +14615,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 4005708588235435073, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 4040845933795309188, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: pelletRenderer
value:
objectReference: {fileID: 1157790591}
- target: {fileID: 4040845933795309188, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14583,10 +14623,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 4054080213664381868, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 4054778616656183051, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4141696458541893057, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14595,10 +14631,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 4198411551151104348, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 4219034801460140058, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4227910356677250806, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14695,6 +14727,54 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 4698741626709871998, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalScale.x
value: 0.21968801
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalScale.y
value: 0.21968801
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalScale.z
value: 0.21968801
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.x
value: -0.23
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.y
value: 7.61
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.z
value: -20.12
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.w
value: 0.6825807
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.x
value: -0.6825807
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.y
value: 0.18461756
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalRotation.z
value: 0.18461756
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 30.269
objectReference: {fileID: 0}
- target: {fileID: 4751825057426557829, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14723,14 +14803,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 5020539064116364618, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 5021651896465857381, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5031360617562026835, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 5031360617562026835, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 5065653594087680395, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14747,18 +14819,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 5162299099997422342, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 5205524283141451703, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5205524283141451703, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.x
value: 16.5
objectReference: {fileID: 0}
- target: {fileID: 5205524283141451703, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5207215077183388049, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14851,10 +14911,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 5674176535737865707, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 5707087752765363600, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 5707087752765363600, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 5754891322239320590, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14907,10 +14963,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 6074801139074197290, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 6124172593973027271, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6155378856640629001, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -14983,14 +15035,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 6771030402075369292, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 6781781304980909979, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 6781781304980909979, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 6789564741839907965, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6822019726439862461, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -15115,10 +15159,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 7504275367788617308, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 7509279530340600537, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7514971118247068176, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -15127,10 +15167,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 7573811225412740220, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 7577918268698087260, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: collisionManager
value:
objectReference: {fileID: 1777057130}
- target: {fileID: 7577918268698087260, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -15167,10 +15203,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 7714172614521704433, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 7719584171925822087, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 7719584171925822087, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 7731328103401244395, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -15203,10 +15235,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 7915156974697007645, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 7957756277511463930, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7975642066508302169, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -15279,14 +15307,6 @@ PrefabInstance:
propertyPath: serializationData.Prefab
value:
objectReference: {fileID: 8632957936983998509, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
- target: {fileID: 8633931985557641148, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8633931985557641148, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: m_LocalPosition.x
value: -16.5
objectReference: {fileID: 0}
- target: {fileID: 8654957424707515056, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
propertyPath: serializationData.Prefab
value:
@@ -15340,8 +15360,7 @@ PrefabInstance:
value:
objectReference: {fileID: 9191377896296995294, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 4879515261813748277, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 760989357904163835, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}

View File

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

View File

@@ -43,7 +43,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 16
Data: 18
- Name:
Entry: 7
Data:
@@ -109,25 +109,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: <PelletCollectedCount>k__BackingField
Data: gameManager
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: <PelletCollectedCount>k__BackingField
Data: gameManager
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -163,19 +163,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: gameManager
Data: bonusFruit
- Name: $v
Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: gameManager
Data: bonusFruit
- Name: <UserType>k__BackingField
Entry: 7
Data: 10|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp
- Name:
Entry: 8
Data:
@@ -217,25 +217,31 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: bonusFruit
Data: pellets
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: bonusFruit
Data: pellets
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp
Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Entry: 7
Data: 14|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -250,7 +256,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -271,31 +277,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: pellets
Data: powerPellets
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pellets
Data: powerPellets
- 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
Data: 17|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule
Data: UnityEngine.Animator[], UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 17
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -331,25 +331,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: powerPellets
Data: ghosts
- Name: $v
Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPellets
Data: ghosts
- Name: <UserType>k__BackingField
Entry: 7
Data: 20|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator[], UnityEngine.AnimationModule
Data: Marro.PacManUdon.Ghost[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 20
Data: 14
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -385,25 +385,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: ghosts
Data: collisionMap
- Name: $v
Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ghosts
Data: collisionMap
- Name: <UserType>k__BackingField
Entry: 7
Data: 23|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Ghost[], Assembly-CSharp
Data: System.Byte[], mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 17
Data: 23
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -439,19 +439,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: powerPelletBlinkEnabled
Data: pelletIndices
- Name: $v
Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletBlinkEnabled
Data: pelletIndices
- Name: <UserType>k__BackingField
Entry: 7
Data: 26|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
Data: System.Int32[], mscorlib
- Name:
Entry: 8
Data:
@@ -493,19 +493,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: powerPelletBlinkToggleInterval
Data: powerPelletBlinkEnabled
- Name: $v
Entry: 7
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletBlinkToggleInterval
Data: powerPelletBlinkEnabled
- Name: <UserType>k__BackingField
Entry: 7
Data: 29|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
@@ -547,19 +547,73 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: powerPelletBlinkProgress
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
Entry: 1
Data: powerPelletBlinkProgress
- Name: <UserType>k__BackingField
Entry: 9
Data: 29
Data: 32
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
Data: 32
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -574,7 +628,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -598,70 +652,16 @@ MonoBehaviour:
Data: powerPelletBlinkCurrentlyVisible
- Name: $v
Entry: 7
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletBlinkCurrentlyVisible
- Name: <UserType>k__BackingField
Entry: 9
Data: 26
Data: 29
- 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: 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: syncedPelletsCollected
- Name: $v
Entry: 7
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: syncedPelletsCollected
- Name: <UserType>k__BackingField
Entry: 7
Data: 36|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Byte[], mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 36
Data: 29
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -697,19 +697,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: collisionMap
Data: pelletMap
- Name: $v
Entry: 7
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: collisionMap
Data: pelletMap
- Name: <UserType>k__BackingField
Entry: 9
Data: 36
Data: 23
- Name: <SystemType>k__BackingField
Entry: 9
Data: 36
Data: 23
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -745,19 +745,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: pelletMap
Data: syncedPelletsCollected
- Name: $v
Entry: 7
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pelletMap
Data: syncedPelletsCollected
- Name: <UserType>k__BackingField
Entry: 9
Data: 36
Data: 23
- Name: <SystemType>k__BackingField
Entry: 9
Data: 36
Data: 23
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -793,19 +793,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: ghostPositions
Data: pelletCollectedCount
- Name: $v
Entry: 7
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ghostPositions
Data: pelletCollectedCount
- Name: <UserType>k__BackingField
Entry: 7
Data: 43|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32[], mscorlib
Data: System.Byte, mscorlib
- Name:
Entry: 8
Data:
@@ -847,19 +847,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: pacManPosition
Data: ghostPositions
- Name: $v
Entry: 7
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pacManPosition
Data: ghostPositions
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
Data: 26
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 26
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -890,6 +890,108 @@ MonoBehaviour:
- 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:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:

View File

@@ -13,31 +13,33 @@ namespace Marro.PacManUdon
public class CollisionManager : SyncedObject
{
public int PelletCount => pellets.Length;
public int PelletCollectedCount { get; private set; }
private GameManager gameManager;
private BonusFruit bonusFruit;
private Pellet[] pellets;
private Animator[] powerPellets;
private Ghost[] ghosts;
Pellet[] pellets;
Animator[] powerPellets;
Ghost[] ghosts;
private byte[] collisionMap;
private int[] pelletIndices;
bool powerPelletBlinkEnabled;
float powerPelletBlinkToggleInterval;
float powerPelletBlinkProgress;
bool powerPelletBlinkCurrentlyVisible;
private const int mazeWidth = 32;
private const int mazeHeight = 32;
byte[] syncedPelletsCollected;
private bool powerPelletBlinkEnabled;
private float powerPelletBlinkToggleInterval;
private float powerPelletBlinkProgress;
private bool powerPelletBlinkCurrentlyVisible;
byte[] collisionMap;
byte[] pelletMap;
const int mazeWidth = 32;
const int mazeHeight = 32;
private byte[] pelletMap;
private byte[] syncedPelletsCollected;
private byte pelletCollectedCount;
private int[] ghostPositions = new int[4];
private int pacManPosition;
private bool frozen;
public void Initialize(GameManager gameManager, BonusFruit bonusFruit, Ghost[] ghosts)
{
this.gameManager = gameManager;
@@ -49,13 +51,28 @@ namespace Marro.PacManUdon
powerPellets = GetComponentsInChildren<Animator>(true);
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
SetPowerPelletsBlink(false);
collisionMap = PacManConstants.GetMazeCollisionInfo();
pelletIndices = PacManConstants.GetMazePelletIndices();
Reset();
}
public void Reset()
{
SetPowerPelletsBlink(false);
RestoreAllPellets();
}
SubscribeToEvent(NetworkEventType.SyncPellets);
internal void SetFrozen(bool frozen)
{
this.frozen = frozen;
if (!frozen)
{
SetPowerPelletsBlink(true);
}
}
#region Collision
@@ -74,9 +91,9 @@ namespace Marro.PacManUdon
ghostPositions[ghostIndex] = tile;
if (tile == pacManPosition)
if (!frozen && tile == pacManPosition)
{
Debug.Log("Ghost hit PacMan!");
//Debug.Log("Ghost hit PacMan!");
ghosts[ghostIndex].HitPacMan();
}
@@ -90,20 +107,28 @@ namespace Marro.PacManUdon
pacManPosition = tilemapIndex;
TryEatGhost(tilemapIndex);
if (!frozen)
{
PacManTryEatGhost();
}
TryCollectFruit(tile, position);
return TryCollectPellet(tile, tilemapIndex);
}
private void TryEatGhost(int tilemapIndex)
internal void PacManTryEatGhost()
{
for (int i = 0; i < ghosts.Length; i++)
{
if (ghostPositions[i] == tilemapIndex)
if (ghostPositions[i] != pacManPosition)
{
Debug.Log("PacMan hit ghost!");
ghosts[i].HitPacMan();
continue;
}
if (ghosts[i].HitPacMan()) // Only one collision may happen at a time
{
//Debug.Log("PacMan hit ghost!");
return;
}
}
}
@@ -162,11 +187,11 @@ namespace Marro.PacManUdon
var index = pellet.transform.GetSiblingIndex();
syncedPelletsCollected[index / 8] |= (byte)(1 << index % 8);
PelletCollectedCount++;
pelletCollectedCount++;
var pelletType = pellet.isPowerPellet ? EatResult.PowerPellet : EatResult.Pellet;
gameManager.GotPellet(pellet, pellet.isPowerPellet, PelletCollectedCount, PelletCount - PelletCollectedCount);
gameManager.GotPellet(pellet, pellet.isPowerPellet, pelletCollectedCount, PelletCount - pelletCollectedCount);
return pelletType;
}
@@ -179,7 +204,7 @@ namespace Marro.PacManUdon
}
syncedPelletsCollected = new byte[pellets.Length/8 + 1];
PelletCollectedCount = 0;
pelletCollectedCount = 0;
pelletMap = PacManConstants.GetMazePelletMap();
@@ -188,10 +213,11 @@ namespace Marro.PacManUdon
private void SetPelletsCollectedFromSync()
{
for (int i = 0; i < pellets.Length; i++)
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
@@ -241,26 +267,20 @@ namespace Marro.PacManUdon
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.SyncPellets)
{
return;
}
data.Append((byte)PelletCollectedCount, ref index);
data.Append(pelletCollectedCount, ref index);
data.Append(syncedPelletsCollected, ref index);
data.Append(frozen, ref index);
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.SyncPellets)
{
return true;
}
PelletCollectedCount = data.ReadByte(ref index);
pelletCollectedCount = data.ReadByte(ref index);
Array.Copy(data, index, syncedPelletsCollected, 0, syncedPelletsCollected.Length);
index += syncedPelletsCollected.Length;
SetPelletsCollectedFromSync();
frozen = data.ReadBool(ref index);
return true;
}
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,6 @@ namespace Marro.PacManUdon
[SerializeField] private GameObject intermissionScreen;
[SerializeField] private GameObject pressStartButtonScreen;
[SerializeField] private PlayerInput playerInput;
[SerializeField] private Animator demo;
[SerializeField] private SoundManager soundManager;
[SerializeField] private NetworkManager networkManagerSetup;
@@ -68,7 +67,7 @@ namespace Marro.PacManUdon
intermission2Pole.Initialize(this, ghostManager.Ghosts[0]);
SubscribeToEvent(NetworkEventType.StartGameButtonPressed);
SubscribeToEvent(NetworkEventType.TimeSequenceSync);
SubscribeToEvent(NetworkEventType.FullSync);
HideEverything();
@@ -107,7 +106,7 @@ namespace Marro.PacManUdon
Debug.Log($"{gameObject} Start Game Button was pressed!");
if (networkManager.IsOwner)
{
networkManager.SendEventNow(NetworkEventType.StartGameButtonPressed);
networkManager.SendEventSoon(NetworkEventType.StartGameButtonPressed, false);
}
StartTimeSequence(PacManTimeSequence.StartNewGame);
}
@@ -132,28 +131,18 @@ namespace Marro.PacManUdon
SetLevel(1);
}
private void InitializeLevel()
{
//Debug.Log($"{gameObject} New level started!");
collisionManager.RestoreAllPellets();
ghostManager.NewLevel();
mazeSpriteAnimator.SetBool("Blinking", false);
}
private void RestartLevel(bool afterLifeLost = false)
{
//Debug.Log($"{gameObject} (Re)started level!");
// SetInGameComponentVisibility(true);
mazeSpriteAnimator.SetBool("Blinking", false);
ghostManager.RestartLevel(afterLifeLost);
pacMan.Reset();
bonusFruit.Despawn();
soundManager.Reset();
collisionManager.SetPowerPelletsBlink(false);
collisionManager.Reset();
statusDisplay.Reset();
}
private void PrepareForCutscene()
@@ -229,12 +218,11 @@ namespace Marro.PacManUdon
AddScore(scoreBonus);
StartTimeSequence(PacManTimeSequence.GhostCaught);
pacMan.HideUntilUnfrozen();
}
public void PacManCaught()
{
//return;
return;
StartTimeSequence(PacManTimeSequence.PacManCaught);
}
@@ -275,7 +263,6 @@ namespace Marro.PacManUdon
statusDisplay.SetLevelDisplayVisible(false);
statusDisplay.SetPlayer1TextVisible(false);
statusDisplay.SetReadyTextVisible(false);
demo.gameObject.SetActive(false);
}
void SetPelletsActive(bool active)
@@ -385,36 +372,66 @@ namespace Marro.PacManUdon
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)
{
// Debug.Log($"{gameObject} Set Frozen: {frozen}");
pacMan.SetFrozen(frozen);
bonusFruit.SetFrozen(frozen);
ghostManager.SetFrozen(frozen, ignoreIfCaught: ghostIgnoreIfCaught);
if (!frozen)
{
collisionManager.SetPowerPelletsBlink(true);
}
collisionManager.SetFrozen(frozen);
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType == NetworkEventType.TimeSequenceSync)
if (eventType != NetworkEventType.FullSync)
{
data.Append(currentlyInTimeSequence, ref index);
if (currentlyInTimeSequence)
{
data.AppendAsByte((int)currentTimeSequence, ref index);
data.Append(timeSequenceSecondsPassed, ref index);
}
return;
}
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)gameState) };
//data[offset++] = BitConverter.GetBytes(currentlyInTimeSequence);
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)currentTimeSequence) };
//data[offset++] = BitConverter.GetBytes(timeSequenceSecondsPassed);
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);
if (currentlyInTimeSequence)
{
data.AppendAsByte((int)currentTimeSequence, ref index);
data.Append(timeSequenceSecondsPassed, ref index);
}
bonusFruit.CollectSyncedData(data, ref index, eventType);
collisionManager.CollectSyncedData(data, ref index, eventType);
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)
@@ -422,30 +439,48 @@ namespace Marro.PacManUdon
if (eventType == NetworkEventType.StartGameButtonPressed)
{
StartGameButtonPressed();
return true;
}
if (eventType == NetworkEventType.TimeSequenceSync)
if (eventType != NetworkEventType.FullSync)
{
var currentlyInTimeSequence = data.ReadBool(ref index);
if (currentlyInTimeSequence)
{
var currentTimeSequence = (PacManTimeSequence)data.ReadByte(ref index);
var timeSequenceSecondsPassed = data.ReadFloat(ref index);
TimeSequenceSyncWithRemote(currentTimeSequence, timeSequenceSecondsPassed);
}
else
{
TimeSequenceTryEndCurrent();
}
return true;
}
//SetGameState((PacManGameState)data[offset++]);
// 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();
}
//var currentlyInTimeSequence = BitConverter.ToBoolean(data, offset++);
//var currentTimeSequence = (PacManTimeSequence)data[offset++];
//var timeSequenceSecondsPassed = BitConverter.ToSingle(data, offset);
//offset += 4;
//TimeSequenceSyncWithRemote(currentlyInTimeSequence, currentTimeSequence, timeSequenceSecondsPassed);
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 timeSequenceSecondsPassed = data.ReadFloat(ref index);
TimeSequenceSyncWithRemote(currentTimeSequence, timeSequenceSecondsPassed);
}
// 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.
bonusFruit.WriteSyncedData(data, ref index, eventType);
collisionManager.WriteSyncedData(data, ref index, eventType);
ghostManager.WriteSyncedData(data, ref index, eventType);
pacMan.WriteSyncedData(data, ref index, eventType);
soundManager.WriteSyncedData(data, ref index, eventType);
return true;
}

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,15 @@ namespace Marro.PacManUdon
Special,
}
enum PacManGhostAnimatorState
{
Normal,
Caught,
Scared,
ScaredWhite,
Special
}
public enum PacManGhostState
{
Normal,
@@ -22,7 +31,8 @@ namespace Marro.PacManUdon
Returning,
Entering,
Home,
Exiting
Exiting,
WaitingForStart,
}
public enum PacManGhostStartState
@@ -38,6 +48,7 @@ namespace Marro.PacManUdon
{
[SerializeField] private PacManGhostType ghostType;
[SerializeField] private PacManGhostStartState startState;
[SerializeField] private GameObject targetIndicator;
// External references
private GhostManager ghostManager;
@@ -48,9 +59,7 @@ namespace Marro.PacManUdon
private Ghost blinky;
private ScoreBonusDisplay scoreBonusDisplay;
private Vector3 startPosition;
private Quaternion startRotation;
private Vector2 startPosition;
private Vector2 homePosition;
private Vector2 idlePosition1;
private Vector2 idlePosition2;
@@ -68,6 +77,7 @@ namespace Marro.PacManUdon
// State
private PacManGhostState ghostState;
private bool isScared;
private bool whiteScared;
private bool scattering;
private PacManGhostFrozenState frozenState;
@@ -76,7 +86,6 @@ namespace Marro.PacManUdon
private int housePelletCounter;
private bool housePelletCounterActive;
private int housePelletCounterLimit;
private bool faceInStartingDirectionUntilUnfrozen;
// Cutscene
private bool kinematic;
@@ -109,47 +118,44 @@ namespace Marro.PacManUdon
scoreBonusDisplay = transform.Find("ScoreBonusDisplay").gameObject.GetComponent<ScoreBonusDisplay>();
scoreBonusDisplay.Initialize();
startPosition = startTransform.localPosition;
startRotation = startTransform.localRotation;
frozenState = PacManGhostFrozenState.Frozen;
Index = index;
SubscribeToEvent(NetworkEventType.GhostUpdate);
targetIndicator.transform.parent = transform.parent;
}
public void Reset()
{
// Debug.Log($"{gameObject} Reset!");
transform.SetLocalPositionAndRotation(startPosition, startRotation);
if (startState == PacManGhostStartState.Outside)
{
ghostState = PacManGhostState.Exiting;
OffGridTargetReached();
}
else
{
if (startState == PacManGhostStartState.TargetingIdlePosition1)
{
SetOffGridTarget(idlePosition1, false);
}
ghostState = PacManGhostState.Entering;
OffGridTargetReached();
}
SetPosition(startPosition);
offGrid = true;
isScared = false;
inTunnel = false;
kinematic = false;
followingPredefinedPath = false;
turnAroundSoon = false;
specialLook = false;
rngState = 1;
UpdateSpeed();
faceInStartingDirectionUntilUnfrozen = true;
UpdateAnimator();
ghostState = PacManGhostState.WaitingForStart;
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}");
}
@@ -157,7 +163,7 @@ namespace Marro.PacManUdon
public override void SyncedUpdate()
{
if (frozenState == PacManGhostFrozenState.Frozen ||
(frozenState == PacManGhostFrozenState.FrozenIfNotCaught && ghostState != PacManGhostState.Returning && ghostState != PacManGhostState.Entering))
(frozenState == PacManGhostFrozenState.FrozenIfNotCaught && ghostState != PacManGhostState.Returning && ghostState != PacManGhostState.Entering))
{
return;
}
@@ -186,6 +192,25 @@ namespace Marro.PacManUdon
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)
{
PerformOffgridRelatedMovement(position, ref nextPosition);
@@ -263,30 +288,50 @@ namespace Marro.PacManUdon
var upcomingGridPosition = PositionToGrid(position + directionVectors[(int)direction]);
var availableDirections = collisionManager.GetAvailableDirections(upcomingGridPosition);
if ((availableDirections & (int)PacManCollisionInfoType.NoTurn) != 0 )
if ((availableDirections & (int)PacManCollisionInfoType.NoTurn) != 0)
{
return;
}
availableDirections &= ~(int)GetInverseDirection(direction); // Not allowed to turn around
if (!isScared && (availableDirections & (int)PacManCollisionInfoType.HorizontalOnly) != 0)
{
availableDirections &= ~0b0011;
availableDirections &= 0b1100;
}
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(upcomingGridPosition);
var newDirection = GetGridDirectionToTargetGreedy(availableDirections, upcomingGridPosition, target);
if (newDirection == direction)
{
return;
}
SetTargetDirection(newDirection);
//Debug.Log($"{gameObject.name} Turned from direction {direction} to direction {newDirection}");
}
// 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);
@@ -310,7 +355,7 @@ namespace Marro.PacManUdon
if (nextValidDirectionIndex == predefinedPathIndex)
{
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
do
@@ -331,57 +376,57 @@ namespace Marro.PacManUdon
}
}
Vector2 GetGridTarget(Vector2 gridPosition)
private Vector2 GetGridTarget(Vector2 gridPosition)
{
// if (followingPredefinedPath)
// {
// predefinedPathIndex++;
// if (predefinedPathIndex >= predefinedPath.Length)
// {
// followingPredefinedPath = false;
// }
// return gridPosition + predefinedPath[predefinedPathIndex];
// }
if (isScared)
{
return gridPosition + directionVectors[(int)cardinalDirections[PseudoRNG() % 4]];
}
switch (ghostState)
if (ghostState == PacManGhostState.Returning)
{
return homePosition;
}
if (scattering)
{
return cornerPosition;
}
switch (ghostType)
{
default:
return gridPosition;
case PacManGhostState.Normal:
if (scattering)
case PacManGhostType.Blinky: // Chase PacMan directly
return PositionToGrid(pacMan.GetPosition());
case PacManGhostType.Pinky: // Try to get ahead of PacMan
return GetTargetAheadOfPacMan(4);
case PacManGhostType.Inky: // Try to attack from the opposite side of Blinky
var blinkyPosition = PositionToGrid(blinky.GetPosition());
return ((GetTargetAheadOfPacMan(2) - blinkyPosition) * 2) + blinkyPosition;
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 cornerPosition;
}
switch (ghostType)
{
default:
return gridPosition;
case PacManGhostType.Blinky:
return PositionToGrid(pacMan.transform.localPosition);
case PacManGhostType.Pinky:
return PositionToGrid(pacMan.transform.localPosition) + pacMan.GetVector(direction) * 4;
case PacManGhostType.Inky:
return 2 * PositionToGrid(pacMan.transform.localPosition) + 4 * pacMan.GetVector(direction) - PositionToGrid(blinky.transform.localPosition);
case PacManGhostType.Clyde:
if (Vector2.Distance(gridPosition, PositionToGrid(pacMan.transform.localPosition)) >= 8)
{
return PositionToGrid(pacMan.transform.localPosition);
}
else
{
// Debug.Log($"{gameObject} goes to cornerPosition {cornerPosition}");
return cornerPosition;
}
}
case PacManGhostState.Returning:
return homePosition;
return pacManPosition;
}
}
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)
{
return (currentPosition.x - target.x) * (nextPosition.x - target.x) <= 0.01;
@@ -452,13 +497,12 @@ namespace Marro.PacManUdon
}
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 bestDirection = Direction.Zero;
float bestDistance = float.MaxValue;
foreach (var direction in horizontalOnly ? horizontalDirections : cardinalDirections)
foreach (var direction in cardinalDirections)
{
if (((int)direction & availableDirections) == 0)
{
@@ -496,41 +540,32 @@ namespace Marro.PacManUdon
if (!gameObject.activeInHierarchy)
return;
// Debug.Log($"{gameObject} UpdateAnimator with state: {ghostState}, isScared: {isScared}, direction: {direction}");
if (specialLook)
if (frozenState == PacManGhostFrozenState.FrozenIfNotCaught) // Looks like a bug but matches the original game
{
SetAnimatorGhostType((int)PacManGhostType.Special);
}
else if (!isScared) // Note: Don't update ghost type while scared as this interrupts the white/blue blinking
{
switch (ghostState)
{
default:
case PacManGhostState.Normal:
case PacManGhostState.Home:
case PacManGhostState.Exiting:
// Debug.Log($"{gameObject} Set GhostType in animator to: {GhostTypeToAnimationValue(ghostType)}");
SetAnimatorGhostType((int)ghostType);
break;
case PacManGhostState.Returning:
case PacManGhostState.Entering:
SetAnimatorGhostType((int)PacManGhostType.Caught);
break;
}
return;
}
if (faceInStartingDirectionUntilUnfrozen && startState == PacManGhostStartState.TargetingIdlePosition1)
{
SetAnimatorDirection((int)Direction.Up);
}
else if (faceInStartingDirectionUntilUnfrozen && startState == PacManGhostStartState.TargetingIdlePosition2)
{
SetAnimatorDirection((int)Direction.Down);
}
else if (specialLook || targetDirection != Direction.Zero)
if (specialLook || targetDirection != Direction.Zero)
{
SetAnimatorDirection((int)targetDirection);
}
PacManGhostType ghostType = this.ghostType;
if (isScared)
{
ghostType = whiteScared ? PacManGhostType.ScaredWhite : PacManGhostType.Scared;
}
else if (ghostState == PacManGhostState.Returning || ghostState == PacManGhostState.Entering)
{
ghostType = PacManGhostType.Caught;
}
else if (specialLook)
{
ghostType = PacManGhostType.Special;
}
SetAnimatorGhostType((int)ghostType);
}
// 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
@@ -565,18 +600,23 @@ namespace Marro.PacManUdon
}
}
internal void HitPacMan()
internal bool HitPacMan()
{
if (ghostState != PacManGhostState.Normal)
{
return false;
}
if (isScared)
{
Debug.Log($"{gameObject} was cought!");
ghostManager.GhostCaughtQueue(this);
}
else if (ghostState == PacManGhostState.Normal)
{
Debug.Log($"{gameObject} cought PacMan!");
ghostManager.CapturedPacMan();
//Debug.Log($"{gameObject} was cought!");
ghostManager.GhostCaught(this);
return true;
}
//Debug.Log($"{gameObject} cought PacMan!");
ghostManager.CapturedPacMan();
return true;
}
public void Caught(int scoreBonus)
@@ -640,13 +680,8 @@ namespace Marro.PacManUdon
private void SetScared(bool scared)
{
isScared = scared;
UpdateAnimator();
SetWhite(false);
UpdateSpeed();
if (isScared)
{
SetWhite(false);
}
}
public void SetScattering(bool scattering, bool reverseDirection = true)
@@ -667,25 +702,32 @@ namespace Marro.PacManUdon
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)
{
frozenState = PacManGhostFrozenState.Frozen;
return;
}
else if (frozen && ignoreIfCaught)
if (frozen && ignoreIfCaught)
{
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();
}
if (ghostState == PacManGhostState.CaughtScore)
{
ReturnHome(); // Return home when unfreezing after being caught
}
}
public void SetHousePelletCounterActive(bool active)
@@ -700,10 +742,8 @@ namespace Marro.PacManUdon
public void SetWhite(bool white)
{
if (!isScared || !gameObject.activeInHierarchy)
return;
SetAnimatorGhostType(white ? (int)PacManGhostType.ScaredWhite : (int)PacManGhostType.Scared);
whiteScared = white;
UpdateAnimator();
}
public void SetElroy(int elroyLevel)
@@ -768,7 +808,7 @@ namespace Marro.PacManUdon
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.GhostUpdate)
if (eventType != NetworkEventType.FullSync)
{
return;
}
@@ -782,21 +822,22 @@ namespace Marro.PacManUdon
data.AppendAsByte((int)ghostState, ref index);
data.Append(isScared, ref index);
data.Append(whiteScared, ref index);
data.Append(scattering, ref index);
data.AppendAsByte((int)frozenState, ref index);
data.Append(offGrid, ref index);
data.AppendAsByte(housePelletCounter, ref index);
data.Append(housePelletCounterActive, ref index);
data.AppendAsByte(housePelletCounterLimit, ref index);
data.Append(faceInStartingDirectionUntilUnfrozen, ref index);
base.CollectSyncedData(data, ref index, eventType);
data.AppendAsByte((int)frozenState, ref index);
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.GhostUpdate)
if (eventType != NetworkEventType.FullSync)
{
return true;
}
@@ -810,16 +851,23 @@ namespace Marro.PacManUdon
ghostState = (PacManGhostState)data.ReadByte(ref index);
isScared = data.ReadBool(ref index);
whiteScared = data.ReadBool(ref index);
scattering = data.ReadBool(ref index);
frozenState = (PacManGhostFrozenState)data.ReadByte(ref index);
offGrid = data.ReadBool(ref index);
housePelletCounter = data.ReadByte(ref index);
housePelletCounterActive = data.ReadBool(ref index);
housePelletCounterLimit = data.ReadByte(ref index);
faceInStartingDirectionUntilUnfrozen = data.ReadBool(ref index);
return base.WriteSyncedData(data, ref index, eventType);
UpdateSpeed();
frozenState = PacManGhostFrozenState.NotFrozen; // Ensure UpdateAnimator runs fully
var success = base.WriteSyncedData(data, ref index, eventType);
frozenState = (PacManGhostFrozenState)data.ReadByte(ref index);
return success;
}
}
}

View File

@@ -43,7 +43,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 33
Data: 32
- Name:
Entry: 7
Data:
@@ -1081,64 +1081,10 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: ghostScaredQueue
Data: blinkingActivated
- Name: $v
Entry: 7
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
Entry: 1
Data: blinkingActivated
@@ -1162,7 +1108,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1186,7 +1132,7 @@ MonoBehaviour:
Data: blinkCountdown
- Name: $v
Entry: 7
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: blinkCountdown
@@ -1210,7 +1156,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1234,7 +1180,7 @@ MonoBehaviour:
Data: blinkCurrentlyWhite
- Name: $v
Entry: 7
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: blinkCurrentlyWhite
@@ -1258,7 +1204,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1282,7 +1228,7 @@ MonoBehaviour:
Data: scatterCounter
- Name: $v
Entry: 7
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: scatterCounter
@@ -1306,7 +1252,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1330,7 +1276,7 @@ MonoBehaviour:
Data: scatterPatternIndex
- Name: $v
Entry: 7
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: scatterPatternIndex
@@ -1354,7 +1300,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1378,7 +1324,7 @@ MonoBehaviour:
Data: elroyLevel
- Name: $v
Entry: 7
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: elroyLevel
@@ -1402,7 +1348,7 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1426,7 +1372,7 @@ MonoBehaviour:
Data: sharedPelletCounterActive
- Name: $v
Entry: 7
Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: sharedPelletCounterActive
@@ -1450,7 +1396,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1474,7 +1420,7 @@ MonoBehaviour:
Data: sharedPelletCounter
- Name: $v
Entry: 7
Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: sharedPelletCounter
@@ -1496,6 +1442,60 @@ MonoBehaviour:
- Name: <IsSerialized>k__BackingField
Entry: 5
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
Entry: 7
Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
@@ -1519,64 +1519,10 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: sharedPelletCounterReleaseValues
Data: pelletTimeout
- Name: $v
Entry: 7
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
Entry: 1
Data: pelletTimeout
@@ -1600,7 +1546,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1624,7 +1570,7 @@ MonoBehaviour:
Data: frozen
- Name: $v
Entry: 7
Data: 78|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: frozen
@@ -1648,7 +1594,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0
@@ -1672,7 +1618,7 @@ MonoBehaviour:
Data: kinematic
- Name: $v
Entry: 7
Data: 80|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: kinematic
@@ -1696,7 +1642,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
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:
Entry: 12
Data: 0

View File

@@ -33,8 +33,6 @@ namespace Marro.PacManUdon
private float powerPelletCountdown;
private int powerPelletMultiplier;
private DataList ghostScaredQueue;
// Blink logic
private const float blinkCycleRate = 0.233333333f;
private bool blinkingActivated;
@@ -74,13 +72,10 @@ namespace Marro.PacManUdon
ghosts[ghostIndex].Initialize(collisionManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex);
}
SubscribeToEvent(NetworkEventType.GhostUpdate);
}
public void RestartLevel(bool afterLifeLost = false)
{
ghostScaredQueue = new DataList();
powerPelletActive = false;
scatterCounter = 0;
scatterPatternIndex = 0;
@@ -100,10 +95,7 @@ namespace Marro.PacManUdon
}
SetScattering(true, reverseDirection: false);
}
public void NewLevel()
{
SetSharedPelletCounterActive(false);
UpdateElroyLevel(collisionManager.PelletCount);
foreach (Ghost ghost in ghosts)
@@ -186,7 +178,7 @@ namespace Marro.PacManUdon
}
}
public void GhostCaughtQueue(Ghost ghost)
public void GhostCaught(Ghost ghost)
{
if (gameController.GameState == PacManGameState.AttractMode)
{
@@ -194,34 +186,6 @@ namespace Marro.PacManUdon
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);
powerPelletMultiplier += 1;
ghost.Caught(scoreBonus);
@@ -325,7 +289,7 @@ namespace Marro.PacManUdon
for (int i = 0; i < ghosts.Length; i++)
{
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
RestartLevel(); // Reset needed to properly apply level
ghosts[i].UpdateSpeed();
}
}
@@ -487,11 +451,6 @@ namespace Marro.PacManUdon
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.GhostUpdate)
{
return;
}
// Power Pellet logic
data.Append(powerPelletActive, ref index);
data.Append(powerPelletCountdown, ref index);
@@ -519,28 +478,14 @@ namespace Marro.PacManUdon
data.AppendAsByte(gameController.Level, ref index);
var ghostScaredQueueArray = new byte[ghosts.Length];
for (int i = 0; i < ghostScaredQueueArray.Length; i++)
foreach (var ghost in ghosts)
{
var add = ghostScaredQueue.TryGetValue(i, out var ghost);
if (!add)
{
ghostScaredQueueArray[i] = byte.MaxValue; // Add a terminator
break;
}
ghostScaredQueueArray[i] = (byte)((Ghost)ghost.Reference).Index;
ghost.CollectSyncedData(data, ref index, eventType);
}
//Debug.Log($"{gameObject} Sent a ghostScareQueue of length {ghostScaredQueue.Count}");
data.Append(ghostScaredQueueArray, ref index);
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.GhostUpdate)
{
return true;
}
// Power Pellet logic
powerPelletActive = data.ReadBool(ref index);
powerPelletCountdown = data.ReadFloat(ref index);
@@ -569,18 +514,10 @@ namespace Marro.PacManUdon
var level = data.ReadByte(ref index);
SetLevelConstants(level);
ghostScaredQueue.Clear();
for (int i = 0; i < ghosts.Length; i++)
foreach (var ghost in ghosts)
{
var ghostIndex = data[index + i];
if (ghostIndex > ghosts.Length) // Reached terminator
{
break;
}
ghostScaredQueue.Add(ghosts[ghostIndex]);
ghost.WriteSyncedData(data, ref index, eventType);
}
index += ghosts.Length;
//Debug.Log($"{gameObject} Read back a ghostScareQueue of length {ghostScaredQueue.Count}");
return true;
}

View File

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

View File

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

View File

@@ -15,11 +15,8 @@ namespace Marro.PacManUdon
{
FullSyncForced = 0,
FullSync = 1,
PacManTurn = 2,
InputChange = 2,
StartGameButtonPressed = 3,
SyncPellets = 4,
GhostUpdate = 5,
TimeSequenceSync = 6,
Pause = 7,
Resume = 8,
Step = 9,
@@ -68,7 +65,7 @@ namespace Marro.PacManUdon
/// <summary>
/// The time delta at which updates occur.
/// </summary>
[SerializeField] private float tickDelta = 0.0166666667f;
[SerializeField] private float tickDelta = 0.0165f;
#endregion
#region Constants
@@ -165,13 +162,21 @@ namespace Marro.PacManUdon
private bool serializationRequested;
/// <summary>
/// Events to send at the end of SyncedUpdate cycle
/// Events to send at the end of SyncedUpdate cycle.
/// </summary>
private NetworkEventType[] eventsToSend;
private NetworkEventType[] eventsToSendEarly;
/// <summary>
/// Index for <see cref="eventsToSend"/>
/// Index for <see cref="eventsToSendEarly"/>.
/// </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>
/// Queue of events to be transmitted or processed.
@@ -327,7 +332,7 @@ namespace Marro.PacManUdon
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;
@@ -375,7 +380,7 @@ namespace Marro.PacManUdon
RequestEvent(NetworkEventType.FullSync);
}
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized");
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized");
}
public void Update()
@@ -409,7 +414,7 @@ namespace Marro.PacManUdon
ProcessEventsToSend(); // Prepare events from last cycle
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
}
@@ -492,7 +497,7 @@ namespace Marro.PacManUdon
#endregion
#region Sender
public void SendEventSoon(NetworkEventType eventType)
public void SendEventSoon(NetworkEventType eventType, bool early = false)
{
if (!Ready)
{
@@ -501,31 +506,52 @@ namespace Marro.PacManUdon
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;
}
if (eventsQueueIndex > eventsToSend.Length)
if (early)
{
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSend)} overflow!");
HandleError(false);
return;
}
if (eventsToSendEarlyIndex >= eventsToSendEarly.Length)
{
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSendEarly)} overflow!");
HandleError(false);
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()
{
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);
}
eventsToSendLateIndex = 0;
}
public void SendEventNow(NetworkEventType eventType)
public void SendEventNow(NetworkEventType eventType, bool early)
{
if (!Ready)
{
@@ -540,17 +566,24 @@ namespace Marro.PacManUdon
var timestamp = SyncedTimeTicks;
if (early)
{
timestamp--;
}
var eventId = GetNextEventId(lastEventId);
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)
{
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);
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();
@@ -647,7 +680,7 @@ namespace Marro.PacManUdon
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);
@@ -666,7 +699,7 @@ namespace Marro.PacManUdon
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
DequeueEventsFromBuffer(eventTransmissionHistory[eventTransmissionHistoryIndex]);
@@ -711,7 +744,7 @@ namespace Marro.PacManUdon
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;
int index = 0;
@@ -798,7 +831,7 @@ namespace Marro.PacManUdon
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()
@@ -838,19 +871,19 @@ namespace Marro.PacManUdon
return false;
}
if (eventType == NetworkEventType.FullSyncForced)
{
eventType = NetworkEventType.FullSync;
}
var index = (int)HeaderLength; // Skip header
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)
{
foreach (var obj in subscribers)
{
obj.SyncedUpdate();
}
foreach (var obj in subscribers)
{
var success = obj.WriteSyncedData(@event, ref index, eventType);
@@ -878,7 +911,7 @@ namespace Marro.PacManUdon
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!
@@ -907,8 +940,11 @@ namespace Marro.PacManUdon
eventTransmissionHistory = new int[maxEventSendTries];
eventTransmissionHistoryIndex = 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)
@@ -970,7 +1006,7 @@ namespace Marro.PacManUdon
SyncedTime = SyncedTimeTicks * tickDelta;
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()
@@ -1103,11 +1139,6 @@ namespace Marro.PacManUdon
Array.Copy(data, start, result, 0, length);
return result;
}
private static float RoundDown(float value, float precision)
{
return (float)(Math.Floor(value / precision) * precision);
}
#endregion
#region SyncedData
@@ -1197,22 +1228,7 @@ namespace Marro.PacManUdon
public void DoFullSync()
{
SendEventSoon(NetworkEventType.FullSync);
}
public void DoPelletSync()
{
SendEventSoon(NetworkEventType.SyncPellets);
}
public void DoGhostSync()
{
SendEventSoon(NetworkEventType.GhostUpdate);
}
public void DoTimeSequenceSync()
{
SendEventSoon(NetworkEventType.TimeSequenceSync);
SendEventSoon(NetworkEventType.FullSyncForced);
}
public void Pause()

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
using System;
using UnityEngine;
using UnityEngine;
namespace Marro.PacManUdon
{
@@ -12,64 +11,65 @@ namespace Marro.PacManUdon
Dead,
}
enum PacManState
{
Idle,
Normal,
PowerPellet,
Dead,
Big,
}
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Renderer))]
public class PacMan : GridMover
{
private GameManager gameManager;
private PlayerInput input;
private CollisionManager collisionManager;
private Animator animator;
private new Renderer renderer;
private Vector2 startPosition;
private float defaultSpeed;
private float powerPelletSpeed;
private PacManState state;
private float speed;
private Vector3 startPosition;
private Quaternion startRotation;
private Animator animator;
new Renderer renderer;
private bool hideUntilUnfrozen;
private bool dead;
private float freezeSeconds;
private bool frozen;
private bool kinematic;
private bool followingPredefinedPath;
private Direction[] predefinedPath;
private int predefinedPathIndex;
private float freezeSeconds;
private bool frozen;
#region Animator constants
private readonly int animatorKeyState = Animator.StringToHash("State");
private readonly int animatorKeyDirection = Animator.StringToHash("Direction");
#endregion
public void Initialize(PlayerInput input, Transform startTransform, GameManager gameManager, CollisionManager collisionManager)
{
this.gameManager = gameManager;
this.collisionManager = collisionManager;
this.input = input;
animator = GetComponent<Animator>();
renderer = GetComponent<Renderer>();
frozen = false;
hideUntilUnfrozen = false;
startPosition = startTransform.localPosition;
startRotation = startTransform.localRotation;
SubscribeToEvent(NetworkEventType.PacManTurn);
}
public void Reset()
{
transform.SetLocalPositionAndRotation(startPosition, startRotation);
SetPosition(startPosition);
direction = Direction.Left;
targetDirection = Direction.Left;
speed = defaultSpeed;
kinematic = false;
followingPredefinedPath = false;
SetDead(false);
state = PacManState.Idle;
SetAnimatorState((int)PacManAnimatorState.Idle);
UpdateSpeed();
UpdateAnimator();
}
public override void SyncedUpdate()
@@ -81,30 +81,7 @@ namespace Marro.PacManUdon
return;
}
if (hideUntilUnfrozen)
{
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;
}
float speed = GetNextSpeed();
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
@@ -129,6 +106,33 @@ namespace Marro.PacManUdon
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)
{
if (CrossesTileCenter(position, nextPosition, Direction.Left) // If pacman is moving horizontally, check if he may cross the center of a tile in that axis
@@ -163,11 +167,6 @@ namespace Marro.PacManUdon
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
if (!followingPredefinedPath)
{
networkManager.SendEventSoon(NetworkEventType.PacManTurn);
}
}
return nextPosition;
@@ -217,32 +216,33 @@ namespace Marro.PacManUdon
if (eatResult == EatResult.Pellet)
{
freezeSeconds = 0.0166666666666667f;
freezeSeconds = 0.0165f;
}
else if (eatResult == EatResult.PowerPellet)
{
freezeSeconds = freezeSeconds = 0.05f;
freezeSeconds = 0.0495f;
}
}
protected override void UpdateAnimator()
{
Debug.Log($"{gameObject} UpdateAnimator with direction {direction}, dead {dead}, frozen {frozen}");
//Debug.Log($"{gameObject} UpdateAnimator with direction {direction}, dead {dead}, frozen {frozen}");
if (!gameObject.activeInHierarchy)
return;
if (dead)
switch (state)
{
SetAnimatorState((int)PacManAnimatorState.Dead);
animator.speed = 1;
return;
}
animator.speed = frozen ? 0 : 1;
if (frozen)
{
return;
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;
return;
}
if (direction.Equals(Direction.Zero))
@@ -252,8 +252,12 @@ namespace Marro.PacManUdon
else
{
SetAnimatorState((int)PacManAnimatorState.Moving);
SetAnimatorDirection((int)targetDirection);
}
animator.speed = frozen ? 0 : 1;
SetAnimatorDirection((int)targetDirection);
}
private void SetAnimatorDirection(int value) =>
@@ -262,22 +266,22 @@ namespace Marro.PacManUdon
private void SetAnimatorState(int value) =>
animator.SetFloat(animatorKeyState, value);
public void SetDead(bool dead)
public void Die()
{
this.dead = dead;
state = PacManState.Dead;
UpdateAnimator();
}
public void SetFrozen(bool frozen)
{
this.frozen = frozen;
UpdateAnimator();
}
public void HideUntilUnfrozen()
{
hideUntilUnfrozen = true;
SetVisibility(false);
if (!frozen && state == PacManState.Idle)
{
state = PacManState.Normal;
}
UpdateAnimator();
}
public void SetLevel(int level)
@@ -285,11 +289,18 @@ namespace Marro.PacManUdon
// Debug.Log($"{gameObject} SetLevel {level}");
defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level);
powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level);
UpdateSpeed();
}
public void SetPowerPellet(bool powerPellet)
{
if (powerPellet)
state = powerPellet ? PacManState.PowerPellet : PacManState.Normal;
UpdateSpeed();
}
private void UpdateSpeed()
{
if (state == PacManState.PowerPellet)
{
speed = powerPelletSpeed;
}
@@ -323,48 +334,31 @@ namespace Marro.PacManUdon
public void BecomeBig()
{
SetAnimatorState((int)PacManAnimatorState.Big);
state = PacManState.Big;
UpdateAnimator();
}
void SetVisibility(bool visible)
public void SetVisibility(bool visible)
{
renderer.enabled = visible;
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.PacManTurn)
{
return;
}
if (kinematic || frozen || !enabled)
{
index += 1;
base.PadSyncedData(data, ref index, eventType);
return;
}
data.AppendAsByte((int)targetDirection, ref index);
data.AppendAsByte((int)state, ref index);
data.Append(freezeSeconds, ref index);
data.Append(frozen, ref index);
base.CollectSyncedData(data, ref index, eventType);
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.PacManTurn)
{
return true;
}
state = (PacManState)data.ReadByte(ref index);
freezeSeconds = data.ReadFloat(ref index);
frozen = data.ReadBool(ref index);
if (kinematic || frozen || !enabled)
{
index += 1;
base.ConsumeSyncedData(data, ref index, eventType);
return true;
}
SetTargetDirection((Direction)data.ReadByte(ref index));
UpdateSpeed();
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
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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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,
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, 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, 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,
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,
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,
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, 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, 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, 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, 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,
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,
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,
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, 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, 010, 076, 076, 029, 076, 076, 029, 076, 076, 006, 196, 200, 067, 196, 192, 192, 192, 192, 192, 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, 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, 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, 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, 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, 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, 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, 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, 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,
};

View File

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

View File

@@ -1,29 +1,80 @@
namespace Marro.PacManUdon
{
using System;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon.Common;
public class PlayerInput : UdonSharpBehaviour
enum InputMethod
{
KeyboardMouse,
Other,
}
public class PlayerInput : SyncedObject
{
public bool active;
private GameManager gameManager;
Direction inputHorizontal;
Direction inputVertical;
float horizontalValue;
float verticalValue;
bool horizontalPriority;
VRCPlayerApi player;
private VRCPlayerApi player;
private InputMethod inputMethod;
private Direction resultInput;
private Vector2 analogInput;
private bool dirty;
private HandType lastUsedHand;
private bool horizontalPriority;
public void Initialize(GameManager gameManager)
{
this.gameManager = gameManager;
inputHorizontal = Direction.Zero;
inputVertical = Direction.Zero;
horizontalPriority = false;
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()
@@ -67,30 +118,10 @@
{
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)
@@ -99,51 +130,145 @@
{
return;
}
verticalValue = Math.Abs(value);
if (value < -0.5)
{
inputVertical = Direction.Up;
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);
analogInput.y = value;
lastUsedHand = args.handType;
dirty = true;
}
private void SetPriority(bool horizontalPriority)
public override void OnInputMethodChanged(VRCInputMethod inputMethod)
{
if (this.horizontalPriority != horizontalPriority)
switch (inputMethod)
{
player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75);
this.horizontalPriority = horizontalPriority;
case VRCInputMethod.Keyboard:
case VRCInputMethod.Mouse:
this.inputMethod = InputMethod.KeyboardMouse;
return;
default:
this.inputMethod = InputMethod.Other;
return;
}
}
private void UpdateResultInput()
{
dirty = false;
var newResult = GetResultInput(analogInput);
if (newResult == resultInput)
{
return;
}
//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()
{
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)
{
if (eventType != NetworkEventType.InputChange)
{
return inputVertical;
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,8 +0,0 @@
fileFormatVersion: 2
guid: 896816ace5640c644bd057ab48c3b9a1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

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);
break;
case 1:
InitializeLevel();
SetMazeVisible(true);
SetLevel(1);
break;
@@ -323,7 +322,6 @@ namespace Marro.PacManUdon
break;
case 3:
SetPelletsActive(true);
collisionManager.RestoreAllPellets();
statusDisplay.SetGameOverTextVisible(true);
break;
case 4:

View File

@@ -92,7 +92,6 @@ namespace Marro.PacManUdon
pacMan.SetPosition(attractScreenElements[16].transform.localPosition);
pacMan.SetDirection(Direction.Left);
ghostManager.RestartLevel();
ghostManager.SetLevel(2);
ghostManager.SetKinematic(true);
ghostManager.SetActive(true);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,9 +5,8 @@ namespace Marro.PacManUdon
public partial class GameManager
{
// 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.
// 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),
// I'm not redoing this unless I get instantiatable classes before I wrap up this project.
// 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 using partial classes for this, I'm not redoing this unless there's a major Udon update before I wrap up this project.
bool currentlyInTimeSequence;
bool waitingForTimeSequenceFinalize;
bool jumpingToTimeSequence;
@@ -44,7 +43,6 @@ namespace Marro.PacManUdon
jumpingToTimeSequence = true;
TimeSequenceProgressToTime(100000f);
if (waitingForTimeSequenceFinalize)
{
TimeSequenceExecuteFinalize(currentTimeSequence);
@@ -97,29 +95,29 @@ namespace Marro.PacManUdon
private void TimeSequenceFinish(PacManTimeSequence timeSequence)
{
TimeSequenceExecuteFinalize(timeSequence);
networkManager.SendEventSoon(NetworkEventType.TimeSequenceSync);
if (!jumpingToTimeSequence)
{
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,
// jump to the remote's time sequence.
if (!currentlyInTimeSequence
|| currentTimeSequence != this.currentTimeSequence
|| timeSequenceSecondsPassed < this.timeSequenceSecondsPassed)
// If our current time sequence state is incompatible with the remote time sequence, kill it
if (currentlyInTimeSequence && remoteCurrentTimeSequence != currentTimeSequence
|| timeSequenceSecondsPassedRemote < timeSequenceSecondsPassed)
{
StartTimeSequence(currentTimeSequence);
currentlyInTimeSequence = false;
}
// If we're (now) in a time sequence, jump our progress to match the one on the remote
if (currentlyInTimeSequence)
// If we're not/no longer in a time sequence, start the remote's time sequence
if (!currentlyInTimeSequence)
{
TimeSequenceProgressToTime(timeSequenceSecondsPassed);
StartTimeSequence(remoteCurrentTimeSequence);
}
// Jump our progress to match the one on the remote
TimeSequenceProgressToTime(timeSequenceSecondsPassedRemote);
}
#region Events

View File

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

View File

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

View File

@@ -166,15 +166,5 @@ namespace Marro.PacManUdon
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 UnityEngine;
using UdonSharp;
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,8 +0,0 @@
fileFormatVersion: 2
guid: c6e306d768eba5b469eea599abcf4800
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

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,8 +0,0 @@
fileFormatVersion: 2
guid: 184e93443ec1bb24fa4e1db8b51405da
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

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

@@ -65,7 +65,7 @@ namespace Marro.PacManUdon.Dev
map[rightTileIndex] = (int)PacManConsumableType.FruitRight;
}
private void PrintMazeMap()
private static void PrintMazeMap()
{
int[] map = new int[width * height];
var collisionMap = GetCollisionMap();
@@ -73,7 +73,7 @@ namespace Marro.PacManUdon.Dev
for (int i = 0; i < map.Length; i++)
{
byte result = 0;
var tile = collisionMap[i];
var tile = GetTileAtIndex(collisionMap, i);
if (tile == (byte)CollisionMap.Wall)
{
@@ -92,34 +92,34 @@ namespace Marro.PacManUdon.Dev
result |= GetGhostTurnInformation(collisionMap, i, width, height);
map[(i % width) + (height - i / width - 1) * width] = result;
map[i] = result;
}
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;
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;
}
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;
}
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;
}
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;
}
@@ -132,39 +132,14 @@ namespace Marro.PacManUdon.Dev
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;
position = Clamp(position, 0, width - 1, 0, height - 1);
var result = (int)position.x + (int)position.y * width;
var result = ((int)position.x + width) % width + ((int)position.y + height) % height * width;
return result;
}
private static Vector2 Clamp(Vector2 vector, float xMin, float xMax, float yMin, float yMax)
{
if (vector.x < xMin)
{
vector.x = xMin;
}
if (vector.x > xMax)
{
vector.x = xMax;
}
if (vector.y < yMin)
{
vector.y = yMin;
}
if (vector.y > yMax)
{
vector.y = yMax;
}
return vector;
}
private void PrintMap(int[] map, int width)
private static void PrintMap(int[] map, int width)
{
var result = "";
for (int i = 0; i < map.Length; i++)
@@ -187,6 +162,10 @@ namespace Marro.PacManUdon.Dev
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[] {
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();
}
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)
{
bool equal = IsEqual(remoteIndex);
bool equal = IsEqual(remoteIndex, remoteTime);
SetIndicator(equal);
DiscardCapture();
@@ -63,7 +63,7 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
IncrementIndex(ref remoteIndex);
}
private bool IsEqual(int index)
private bool IsEqual(int index, int time)
{
var equal = true;
@@ -79,7 +79,7 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
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();
//networkManager2.Pause();
equal = false;

View File

@@ -43,7 +43,7 @@ public class NetworkManagerTester : UdonSharpBehaviour
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)
{
@@ -91,7 +91,7 @@ public class NetworkManagerTester : UdonSharpBehaviour
continue;
}
Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
//Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
target.RequestEventReceived(eventType);
}

View File

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