Compare commits

..

1 Commits

Author SHA1 Message Date
4ef936bf16 PrepareForCutscene 2025-12-26 18:27:04 +01:00
111 changed files with 63450 additions and 82907 deletions

View File

@@ -1,6 +0,0 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,7 +5,7 @@ TextureImporter:
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0

View File

@@ -5,7 +5,7 @@ TextureImporter:
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0

View File

@@ -5,7 +5,7 @@ TextureImporter:
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0

View File

@@ -5,7 +5,7 @@ TextureImporter:
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0

View File

@@ -5,7 +5,7 @@ TextureImporter:
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

View File

@@ -1,114 +0,0 @@
fileFormatVersion: 2
guid: 433bc126202e0994fa11758168105efa
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 15ac0ed4c56c7784ea3ae9000fc2af1f
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -12,6 +12,8 @@ GameObject:
- component: {fileID: 7954158839068841090}
- component: {fileID: 4205939556154507887}
- component: {fileID: 3684828990246450362}
- component: {fileID: 4887324676098472752}
- component: {fileID: 620240520301056681}
- component: {fileID: 2436955608773050784}
m_Layer: 0
m_Name: Ghost
@@ -34,6 +36,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4191597391212281593}
- {fileID: 4930314721506563510}
- {fileID: 3602007015285256100}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -57,216 +60,10 @@ MonoBehaviour:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: directionVectors
Entry: 7
Data: 0|UnityEngine.Vector2[], UnityEngine.CoreModule
- Name:
Entry: 12
Data: 16
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: -1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: -1
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: -1
- Name:
Entry: 4
Data: -1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: -1
- Name:
Entry: 4
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: -1
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 1
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 1
- Name:
Entry: 4
Data: -1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 1
- Name:
Entry: 4
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 1
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: -1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 4
Data: 0
- Name:
Entry: 4
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
SerializationNodes: []
_udonSharpBackingUdonBehaviour: {fileID: 2436955608773050784}
networkManager: {fileID: 0}
ghostType: 3
startState: 0
targetIndicator: {fileID: 5838653651634851978}
--- !u!212 &4205939556154507887
SpriteRenderer:
m_ObjectHideFlags: 0
@@ -340,6 +137,54 @@ Animator:
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!54 &4887324676098472752
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363162966199215175}
serializedVersion: 4
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!65 &620240520301056681
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363162966199215175}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.5, y: 0.5, z: 2}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &2436955608773050784
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -365,6 +210,61 @@ MonoBehaviour:
serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF
publicVariablesUnityEngineObjects: []
publicVariablesSerializationDataFormat: 0
--- !u!1 &1283232227864845355
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4930314721506563510}
- component: {fileID: 7503794487432367459}
m_Layer: 0
m_Name: PacManCollider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4930314721506563510
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1283232227864845355}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 140452431933686981}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &7503794487432367459
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1283232227864845355}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.25
m_Height: 2
m_Direction: 2
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &5838653651634851978
GameObject:
m_ObjectHideFlags: 0
@@ -376,6 +276,7 @@ GameObject:
- component: {fileID: 4191597391212281593}
- component: {fileID: 7008590632023811945}
- component: {fileID: 1439451148072521473}
- component: {fileID: 3313165921880363939}
m_Layer: 0
m_Name: Target Indicator
m_TagString: Untagged
@@ -448,6 +349,27 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &3313165921880363939
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5838653651634851978}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &6726417638088798178
PrefabInstance:
m_ObjectHideFlags: 0

View File

@@ -11,6 +11,8 @@ GameObject:
- component: {fileID: 1315692994360949719}
- component: {fileID: 967117457436250906}
- component: {fileID: 7512162431685415002}
- component: {fileID: 2135601224056198654}
- component: {fileID: 3963523032509914404}
- component: {fileID: 9117212235706742114}
m_Layer: 0
m_Name: Pellet
@@ -109,7 +111,54 @@ MonoBehaviour:
SerializationNodes: []
_udonSharpBackingUdonBehaviour: {fileID: 9117212235706742114}
isPowerPellet: 0
pelletRenderer: {fileID: 0}
--- !u!65 &2135601224056198654
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4099390335584803315}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.5, y: 0.5, z: 0.5}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &3963523032509914404
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4099390335584803315}
serializedVersion: 4
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &9117212235706742114
MonoBehaviour:
m_ObjectHideFlags: 0

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +1,44 @@
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
namespace Marro.PacManUdon
namespace Marro.PacManUdon
{
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Renderer))]
public class BonusFruit : SyncedObject
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDKBase;
using VRC.Udon;
public class BonusFruit : UdonSharpBehaviour
{
private PacManFruitType fruitType;
[SerializeField, UdonSynced, FieldChangeCallback(nameof(FruitType))] PacManFruitType fruitType;
private Animator animator;
private new Renderer renderer;
private ScoreBonusDisplay scoreBonusDisplay;
private bool active;
private float activeCountdown;
Animator animator;
new Renderer renderer;
new Collider collider;
ScoreBonusDisplay scoreBonusDisplay;
[UdonSynced] bool active;
private int value;
private float activeCountdown;
private bool frozen;
public void Initialize()
{
animator = GetComponent<Animator>();
renderer = GetComponent<Renderer>();
collider = GetComponent<Collider>();
scoreBonusDisplay = transform.Find("ScoreBonusDisplay").gameObject.GetComponent<ScoreBonusDisplay>();
scoreBonusDisplay.Initialize();
SetActive(false);
}
public override void SyncedUpdate()
void Update()
{
if (!active || frozen)
if (active && !frozen)
{
return;
}
activeCountdown -= networkManager.SyncedDeltaTime;
if (activeCountdown <= 0)
{
SetActive(false);
activeCountdown -= Time.deltaTime;
if (activeCountdown <= 0)
{
SetActive(false);
}
}
}
@@ -65,8 +64,10 @@ namespace Marro.PacManUdon
public void SetFruitType(PacManFruitType fruitType)
{
this.fruitType = fruitType;
value = (int)fruitScoreValue[PacManConstants.FruitTypeToValue(fruitType)];
animator.SetFloat("FruitType", PacManConstants.FruitTypeToValue(fruitType));
RequestSerialization();
}
public void SetFrozen(bool frozen)
@@ -77,50 +78,41 @@ namespace Marro.PacManUdon
void SetActive(bool active)
{ // This replaces GameObject.active, as attempting to update an animator while a gameobject is inactive seems to result in a silent failure
renderer.enabled = active;
collider.enabled = active;
this.active = active;
RequestSerialization();
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
public PacManFruitType FruitType
{
data.Append(active, ref index);
if (!active)
set
{
return;
SetFruitType(value);
}
data.Append(activeCountdown, ref index);
data.Append(frozen, ref index);
get => fruitType;
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
public bool Active
{
SetActive(data.ReadBool(ref index));
if (!active)
set
{
return true;
SetActive(value);
}
activeCountdown = data.ReadFloat(ref index);
frozen = data.ReadBool(ref index);
return true;
get => active;
}
public bool Active => active;
private DataDictionary fruitScoreValue = new DataDictionary()
{
{(int)PacManFruitType.None , 0},
{(int)PacManFruitType.Cherries , 100},
{(int)PacManFruitType.Strawberry, 300},
{(int)PacManFruitType.Peach , 500},
{(int)PacManFruitType.Apple , 700},
{(int)PacManFruitType.Grapes , 1000},
{(int)PacManFruitType.Galaxian , 2000},
{(int)PacManFruitType.Bell , 3000},
{(int)PacManFruitType.Key , 5000}
};
private readonly DataDictionary fruitScoreValue = new DataDictionary()
{
{(int)PacManFruitType.None , 0},
{(int)PacManFruitType.Cherries , 100},
{(int)PacManFruitType.Strawberry, 300},
{(int)PacManFruitType.Peach , 500},
{(int)PacManFruitType.Apple , 700},
{(int)PacManFruitType.Grapes , 1000},
{(int)PacManFruitType.Galaxian , 2000},
{(int)PacManFruitType.Bell , 3000},
{(int)PacManFruitType.Key , 5000}
};
}
}

View File

@@ -1,161 +0,0 @@
using System;
using UnityEngine;
namespace Marro.PacManUdon
{
public static class ByteUtils
{
public static void Append(this byte[] target, byte[] value, ref int index)
{
//Debug.Log($"ByteUtils Append {nameof(value)}.Length: {value.Length}, {nameof(target)}.Length : {target.Length}, {nameof(index)}: {index}");
Array.Copy(value, 0, target, index, value.Length);
index += value.Length;
}
public static void Append(this byte[] target, byte value, ref int index) =>
target[index++] = value;
public static void Append(this byte[] target, sbyte value, ref int index) =>
target[index++] = (byte)value;
public static void Append(this byte[] target, bool value, ref int index) =>
target[index++] = value ? (byte)1 : (byte)0;
public static void Append(this byte[] target, ushort value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, short value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, uint value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, int value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
/// <summary>
/// Casts <paramref name="value"/> to a byte and then appends it.
/// Safer than doing <c>Append((byte)value, ref index)</c>, which can crash the Udonbehaviour.
/// </summary>
public static void AppendAsByte(this byte[] target, int value, ref int index) =>
target.Append(value.ToByte(), ref index);
public static void Append(this byte[] target, ulong value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, long value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, float value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, double value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, char value, ref int index) =>
target.Append(BitConverter.GetBytes(value), ref index);
public static void Append(this byte[] target, Vector2 value, ref int index)
{
target.Append(value.x, ref index);
target.Append(value.y, ref index);
}
public static void Append(this byte[] target, Vector3 value, ref int index)
{
target.Append(value.x, ref index);
target.Append(value.y, ref index);
target.Append(value.z, ref index);
}
public static byte ReadByte(this byte[] source, ref int index) =>
source[index++];
public static bool ReadBool(this byte[] source, ref int index) =>
source[index++] > 0;
public static ushort ReadUShort(this byte[] source, ref int index)
{
var value = BitConverter.ToUInt16(source, index);
index += 2;
return value;
}
public static short ReadShort(this byte[] source, ref int index)
{
var value = BitConverter.ToInt16(source, (int)index);
index += 2;
return value;
}
public static uint ReadUInt(this byte[] source, ref int index)
{
var value = BitConverter.ToUInt32(source, index);
index += 4;
return value;
}
public static int ReadInt(this byte[] source, ref int index)
{
var value = BitConverter.ToInt32(source, index);
index += 4;
return value;
}
public static ulong ReadULong(this byte[] source, ref int index)
{
var value = BitConverter.ToUInt64(source, index);
index += 8;
return value;
}
public static long ReadLong(this byte[] source, ref int index)
{
var value = BitConverter.ToInt64(source, index);
index += 8;
return value;
}
public static float ReadFloat(this byte[] source, ref int index)
{
var value = BitConverter.ToSingle(source, index);
index += 4;
return value;
}
public static double ReadDouble(this byte[] source, ref int index)
{
var value = BitConverter.ToDouble(source, index);
index += 8;
return value;
}
public static char ReadChar(this byte[] source, ref int index)
{
var value = BitConverter.ToChar(source, index);
index += 2;
return value;
}
public static Vector2 ReadVector2(this byte[] source, ref int index)
{
var value = new Vector2(BitConverter.ToSingle(source, index), BitConverter.ToSingle(source, index + 4));
index += 8;
return value;
}
public static Vector3 ReadVector3(this byte[] source, ref int index)
{
var value = new Vector3(BitConverter.ToSingle(source, index), BitConverter.ToSingle(source, index + 4), BitConverter.ToSingle(source, index + 8));
index += 12;
return value;
}
/// <summary>
/// Casts an Int32 to a byte.
/// Doing this inline sometimes causes an udon exception, but doing it via a separate method seems to work fine.
/// </summary>
public static byte ToByte(this int value) =>
(byte)value;
}
}

File diff suppressed because it is too large Load Diff

View File

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

@@ -1,120 +1,120 @@
//namespace Marro.PacManUdon
//{
// using System.Collections;
// using System.Collections.Generic;
// using UnityEngine;
// using UnityEditor.Animations;
// using UnityEditor;
namespace Marro.PacManUdon
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Animations;
using UnityEditor;
// public class AnimationRecorder : MonoBehaviour
// {
// [SerializeField] AnimationClip clip;
// [SerializeField] GameObject root;
// [SerializeField] GameObject[] gameObjectsToAnimate;
// private GameObjectRecorder recorder;
public class AnimationRecorder : MonoBehaviour
{
[SerializeField] AnimationClip clip;
[SerializeField] GameObject root;
[SerializeField] GameObject[] gameObjectsToAnimate;
private GameObjectRecorder recorder;
// void Start()
// {
// recorder = new GameObjectRecorder(root);
void Start()
{
recorder = new GameObjectRecorder(root);
// foreach (GameObject gameObject in gameObjectsToAnimate)
// {
// // if(gameObject.GetComponent<PacMan>() || gameObject.GetComponent<Ghost>())
// // {
// // recorder.BindComponentsOfType<Transform>(gameObject, true);
// // }
// // recorder.BindComponentsOfType<Renderer>(gameObject, true);
foreach (GameObject gameObject in gameObjectsToAnimate)
{
// if(gameObject.GetComponent<PacMan>() || gameObject.GetComponent<Ghost>())
// {
// recorder.BindComponentsOfType<Transform>(gameObject, true);
// }
// recorder.BindComponentsOfType<Renderer>(gameObject, true);
// string path = AnimationUtility.CalculateTransformPath(gameObject.transform, root.transform);
string path = AnimationUtility.CalculateTransformPath(gameObject.transform, root.transform);
// recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(GameObject), "m_IsActive"));
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(GameObject), "m_IsActive"));
// Pellet pellet = gameObject.GetComponent<Pellet>();
// if (pellet)
// {
// recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(SpriteRenderer), "m_Enabled"));
// if (pellet.isPowerPellet)
// {
// recorder.Bind(EditorCurveBinding.PPtrCurve(path, typeof(SpriteRenderer), "m_Sprite"));
// }
// continue;
// }
Pellet pellet = gameObject.GetComponent<Pellet>();
if (pellet)
{
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(SpriteRenderer), "m_Enabled"));
if (pellet.isPowerPellet)
{
recorder.Bind(EditorCurveBinding.PPtrCurve(path, typeof(SpriteRenderer), "m_Sprite"));
}
continue;
}
// if (gameObject.GetComponent<SpriteRenderer>())
// {
// recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(SpriteRenderer), "m_Enabled"));
// recorder.Bind(EditorCurveBinding.PPtrCurve(path, typeof(SpriteRenderer), "m_Sprite"));
// }
// else if (gameObject.GetComponent<MeshRenderer>())
// {
// recorder.Bind(EditorCurveBinding.DiscreteCurve(path, typeof(MeshRenderer), "m_Enabled"));
// }
// recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.x"));
// recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.y"));
// recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.z"));
// }
if (gameObject.GetComponent<SpriteRenderer>())
{
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(SpriteRenderer), "m_Enabled"));
recorder.Bind(EditorCurveBinding.PPtrCurve(path, typeof(SpriteRenderer), "m_Sprite"));
}
else if (gameObject.GetComponent<MeshRenderer>())
{
recorder.Bind(EditorCurveBinding.DiscreteCurve(path, typeof(MeshRenderer), "m_Enabled"));
}
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.x"));
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.y"));
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.z"));
}
// EditorCurveBinding[] bindings = recorder.GetBindings();
// foreach (EditorCurveBinding binding in bindings)
// {
// Debug.Log($"{binding.path}, {binding.propertyName}, {binding.type}");
// }
// }
EditorCurveBinding[] bindings = recorder.GetBindings();
foreach (EditorCurveBinding binding in bindings)
{
Debug.Log($"{binding.path}, {binding.propertyName}, {binding.type}");
}
}
// private static string GetGameObjectPathToObject(GameObject obj, Transform target)
// {
// string path = "/" + obj.name;
// while (!obj.transform.parent.Equals(target))
// {
// obj = obj.transform.parent.gameObject;
// path = "/" + obj.name + path;
// }
// Debug.Log($"GetGameObjectPathToTransform from {obj} to {target.gameObject} gives {path}");
// return path;
// }
private static string GetGameObjectPathToObject(GameObject obj, Transform target)
{
string path = "/" + obj.name;
while (!obj.transform.parent.Equals(target))
{
obj = obj.transform.parent.gameObject;
path = "/" + obj.name + path;
}
Debug.Log($"GetGameObjectPathToTransform from {obj} to {target.gameObject} gives {path}");
return path;
}
// void LateUpdate()
// {
// if (clip == null)
// return;
void LateUpdate()
{
if (clip == null)
return;
// recorder.TakeSnapshot(Time.deltaTime);
// }
recorder.TakeSnapshot(Time.deltaTime);
}
// void OnDisable()
// {
// if (clip == null)
// return;
void OnDisable()
{
if (clip == null)
return;
// if (recorder.isRecording)
// {
// recorder.SaveToClip(clip);
// RemoveUnneededCurves(clip);
// }
// }
if (recorder.isRecording)
{
recorder.SaveToClip(clip);
RemoveUnneededCurves(clip);
}
}
// private static void RemoveUnneededCurves(AnimationClip clip)
// {
// // Collect curves to process
// EditorCurveBinding[] bindings = AnimationUtility.GetCurveBindings(clip);
// List<EditorCurveBinding> unneededCurves = new List<EditorCurveBinding>();
private static void RemoveUnneededCurves(AnimationClip clip)
{
// Collect curves to process
EditorCurveBinding[] bindings = AnimationUtility.GetCurveBindings(clip);
List<EditorCurveBinding> unneededCurves = new List<EditorCurveBinding>();
// foreach (var binding in bindings)
// {
// AnimationCurve curve = AnimationUtility.GetEditorCurve(clip, binding);
foreach (var binding in bindings)
{
AnimationCurve curve = AnimationUtility.GetEditorCurve(clip, binding);
// if (curve == null || curve.keys.Length <= 2)
// {
// unneededCurves.Add(binding);
// }
// }
if (curve == null || curve.keys.Length <= 2)
{
unneededCurves.Add(binding);
}
}
// // Remove unchanged curves
// foreach (var binding in unneededCurves)
// {
// AnimationUtility.SetEditorCurve(clip, binding, null);
// Debug.Log($"Removed unchanged curve for property: {binding.propertyName}");
// }
// }
// }
//}
// Remove unchanged curves
foreach (var binding in unneededCurves)
{
AnimationUtility.SetEditorCurve(clip, binding, null);
Debug.Log($"Removed unchanged curve for property: {binding.propertyName}");
}
}
}
}

View File

@@ -49,19 +49,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: networkManager
Data: fruitType
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager
Data: fruitType
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, Assembly-CSharp
Data: Marro.PacManUdon.PacManFruitType, Assembly-CSharp
- Name:
Entry: 8
Data:
@@ -70,7 +70,7 @@ MonoBehaviour:
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
@@ -78,8 +78,8 @@ MonoBehaviour:
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -91,67 +91,25 @@ MonoBehaviour:
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 3
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
Entry: 7
Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: fruitType
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: fruitType
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.PacManFruitType, Assembly-CSharp
Data: 7|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
Entry: 7
Data: 8|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
- 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: false
- Name: _fieldAttributes
Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
@@ -172,13 +130,13 @@ MonoBehaviour:
Data: animator
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: animator
- Name: <UserType>k__BackingField
Entry: 7
Data: 11|System.RuntimeType, mscorlib
Data: 10|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
@@ -187,7 +145,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 10
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -202,7 +160,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
@@ -226,13 +184,13 @@ MonoBehaviour:
Data: renderer
- 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: renderer
- Name: <UserType>k__BackingField
Entry: 7
Data: 14|System.RuntimeType, mscorlib
Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Renderer, UnityEngine.CoreModule
@@ -241,7 +199,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 14
Data: 13
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -256,7 +214,61 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: collider
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: collider
- Name: <UserType>k__BackingField
Entry: 7
Data: 16|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Collider, UnityEngine.PhysicsModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 16
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -280,13 +292,13 @@ MonoBehaviour:
Data: scoreBonusDisplay
- Name: $v
Entry: 7
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: scoreBonusDisplay
- Name: <UserType>k__BackingField
Entry: 7
Data: 17|System.RuntimeType, mscorlib
Data: 19|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.ScoreBonusDisplay, Assembly-CSharp
@@ -294,62 +306,14 @@ MonoBehaviour:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 18|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: active
- Name: $v
Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: active
- Name: <UserType>k__BackingField
Entry: 7
Data: 20|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 20
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -385,22 +349,178 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: activeCountdown
Data: active
- Name: $v
Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: activeCountdown
Data: active
- Name: <UserType>k__BackingField
Entry: 7
Data: 23|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 23
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 25|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: value
- Name: $v
Entry: 7
Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: value
- Name: <UserType>k__BackingField
Entry: 9
Data: 4
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 27|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: activeCountdown
- Name: $v
Entry: 7
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: activeCountdown
- Name: <UserType>k__BackingField
Entry: 7
Data: 29|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: frozen
- Name: $v
Entry: 7
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: frozen
- Name: <UserType>k__BackingField
Entry: 9
Data: 23
- Name: <SystemType>k__BackingField
Entry: 9
Data: 23
@@ -418,103 +538,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: value
- Name: $v
Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: value
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
- 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: 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: frozen
- Name: $v
Entry: 7
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: frozen
- Name: <UserType>k__BackingField
Entry: 9
Data: 20
- Name: <SystemType>k__BackingField
Entry: 9
Data: 20
- 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: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -538,13 +562,13 @@ MonoBehaviour:
Data: fruitScoreValue
- Name: $v
Entry: 7
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: fruitScoreValue
- Name: <UserType>k__BackingField
Entry: 7
Data: 30|System.RuntimeType, mscorlib
Data: 34|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
@@ -553,7 +577,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 30
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -568,7 +592,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 31|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

File diff suppressed because it is too large Load Diff

View File

@@ -1,42 +1,56 @@
using UdonSharp;
using UnityEngine;
#define RECORDING_DEMO
namespace Marro.PacManUdon
{
public partial class GameManager : SyncedObject
using System;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using VRC.SDK3.Components;
using VRC.Udon.Common.Interfaces;
using VRC.SDK3.Data;
public partial class GameManager : UdonSharpBehaviour
{
[Header("Static game components")]
[SerializeField] private Maze[] mazes;
[SerializeField] private PacMan pacMan;
[SerializeField] private GhostManager ghostManager;
[SerializeField] private BonusFruit bonusFruit;
[SerializeField] private CollisionManager collisionManager;
[SerializeField] private StatusDisplay statusDisplay;
[SerializeField] private CollisionManager attractScreen;
[SerializeField] private PelletManager pelletManager;
[SerializeField] public StatusDisplay statusDisplay; // This one is public so other scripts can write to the debug display
[SerializeField] private PelletManager attractScreen;
[SerializeField] private GameObject intermissionScreen;
[SerializeField] private GameObject pressStartButtonScreen;
[SerializeField] private PlayerInput playerInput;
[SerializeField] private Animator demo;
[SerializeField] private SoundManager soundManager;
[SerializeField] private NetworkManager networkManagerSetup;
[SerializeField] private GameObject recorder;
[Header("Game settings")]
[SerializeField] private int startingExtraLives = 3;
[SerializeField] private int scoreToExtraLife = 10000;
[Tooltip("Override amount of pellets needed to clear stage, set to -1 to disable.")]
[SerializeField] private int pelletCountOverride = -1;
private Maze maze;
private VRCObjectPool pelletPool;
private Intermission2Pole intermission2Pole;
private Animator mazeSpriteAnimator;
private int pelletCountTotal;
private int pelletCountRemaining;
private GameObject[] attractScreenElements;
private GameObject[] intermissionScreenElements;
private PacManGameState gameState;
private int score;
private int level;
private int highScore;
private int extraLives;
[UdonSynced, FieldChangeCallback(nameof(GameState))] private PacManGameState gameState;
[UdonSynced, FieldChangeCallback(nameof(Score))] private int score;
[UdonSynced, FieldChangeCallback(nameof(Level))] private int level;
[UdonSynced, FieldChangeCallback(nameof(HighScore))] private int highScore;
[UdonSynced, FieldChangeCallback(nameof(ExtraLives))] private int extraLives;
public void Start()
{
@@ -53,22 +67,19 @@ namespace Marro.PacManUdon
}
maze = mazes[0];
pelletPool = maze.pelletContainer.GetComponent<VRCObjectPool>();
mazeSpriteAnimator = maze.mazeSprite.GetComponent<Animator>();
intermission2Pole = intermissionScreenElements[4].GetComponent<Intermission2Pole>();
networkManager.Initialize();
ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, collisionManager, this);
pacMan.Initialize(playerInput, maze.pacManStart, this, collisionManager);
ghostManager.Initialize(maze.ghostTargets, pacMan, this);
pacMan.Initialize(playerInput, pelletPool, this);
bonusFruit.Initialize();
collisionManager.Initialize(this, bonusFruit, ghostManager.Ghosts);
pelletManager.Initialize(pelletPool);
statusDisplay.Initialize();
playerInput.Initialize(this);
soundManager.Initialize();
intermission2Pole.Initialize(this, ghostManager.Ghosts[0]);
SubscribeToEvent(NetworkEventType.StartGameButtonPressed);
SubscribeToEvent(NetworkEventType.FullSync);
HideEverything();
SetScore(0);
@@ -78,9 +89,9 @@ namespace Marro.PacManUdon
StartAttractMode();
}
public override void SyncedUpdate()
public void FixedUpdate()
{
TimeSequenceUpdate(networkManager.SyncedDeltaTime);
TimeSequenceUpdate(Time.deltaTime);
}
public void JoystickGrabbed()
@@ -104,45 +115,81 @@ namespace Marro.PacManUdon
public void StartGameButtonPressed()
{
Debug.Log($"{gameObject} Start Game Button was pressed!");
if (networkManager.IsOwner)
{
networkManager.SendEventSoon(NetworkEventType.StartGameButtonPressed, false);
}
TakeOwnership();
StartTimeSequence(PacManTimeSequence.StartNewGame);
}
public void SkipLevelButtonPressed()
{
if (Networking.IsOwner(gameObject))
{
Debug.Log($"{gameObject} Skip level button pressed!");
StartTimeSequence(PacManTimeSequence.BoardClear);
TimeSequenceSkipToNextStep();
}
}
public void StartDemoButtonPressed()
{
if (Networking.IsOwner(gameObject))
{
Debug.Log($"{gameObject} Start demo button pressed!");
StartTimeSequence(PacManTimeSequence.Intermission1);
}
}
private void StartAttractMode()
{
// #if RECORDING_DEMO
// #if RECORDING_DEMO
// recorder.gameObject.SetActive(true);
StartTimeSequence(PacManTimeSequence.AttractScreenIntroduction);
// #else
// SetGameState(PacManGameState.AttractMode);
// HideEverything();
// demo.gameObject.SetActive(true);
// #endif
// #else
// SetGameState(PacManGameState.AttractMode);
// HideEverything();
// demo.gameObject.SetActive(true);
// #endif
}
private void InitializeNewGame()
{
//Debug.Log($"{gameObject} Started new game!");
Debug.Log($"{gameObject} Started new game!");
SetScore(0);
SetExtraLives(startingExtraLives);
SetLevel(1);
}
private void RestartLevel(bool afterLifeLost = false)
private void InitializeLevel()
{
//Debug.Log($"{gameObject} (Re)started level!");
Debug.Log($"{gameObject} New level started!");
if (Networking.IsOwner(gameObject))
{
pelletCountTotal = pelletPool.Pool.Length;
pelletCountRemaining = pelletCountTotal;
ghostManager.SetPelletsRemaining(pelletCountRemaining);
ghostManager.NewLevel();
pelletManager.RestoreAllPellets();
if (pelletCountOverride > 0)
{
pelletCountRemaining = pelletCountOverride;
}
}
mazeSpriteAnimator.SetBool("Blinking", false);
}
ghostManager.RestartLevel(afterLifeLost);
private void RestartLevel()
{
Debug.Log($"{gameObject} (Re)started level!");
// SetInGameComponentVisibility(true);
ghostManager.Reset();
pacMan.Reset();
bonusFruit.Despawn();
soundManager.Reset();
collisionManager.Reset();
statusDisplay.Reset();
pelletManager.SetPowerPelletsBlink(false);
}
private void PrepareForCutscene()
@@ -152,45 +199,40 @@ namespace Marro.PacManUdon
SetFrozen(true);
}
internal void GotPellet(Pellet pellet, bool isPowerPellet, int pelletsCollectedCount, int pelletsRemainingCount)
public void GotPellet(bool addScore = true)
{
AddScore(isPowerPellet ? 50 : 10);
pelletCountRemaining--;
if (addScore) AddScore(10);
ghostManager.PelletConsumed(pelletsRemainingCount);
ghostManager.PelletConsumed();
soundManager.PlayPelletSound();
soundManager.UpdatePelletCount(pelletsRemainingCount);
if (pelletsRemainingCount <= 0)
soundManager.UpdatePelletCount(pelletCountRemaining);
int pelletsConsumed = pelletCountTotal - pelletCountRemaining;
if (pelletCountRemaining <= 0)
{
StartTimeSequence(PacManTimeSequence.BoardClear);
return;
}
if (isPowerPellet)
{
if (gameState == PacManGameState.AttractMode)
{
TimeSequenceSkipToNextStep();
return;
}
ghostManager.SetPowerPellet(true);
pacMan.SetPowerPellet(true);
soundManager.SetGhostBlue(true);
}
if (pelletsCollectedCount == 70 || pelletsCollectedCount == 170)
else if (pelletsConsumed == 70 || pelletsConsumed == 170)
{
bonusFruit.Spawn();
}
}
public void GotPowerPellet(Pellet pellet)
public void GotPowerPellet()
{
//Debug.Log($"{gameObject} GotPowerPellet");
if (gameState == PacManGameState.AttractMode)
{
TimeSequenceSkipToNextStep();
return;
}
GotPellet(addScore: false);
AddScore(50);
ghostManager.SetPowerPellet(true);
pacMan.SetPowerPellet(true);
soundManager.SetGhostBlue(true);
}
public void EndPowerPellet()
@@ -208,8 +250,6 @@ namespace Marro.PacManUdon
public void GhostCaught(int scoreBonus)
{
//Debug.Log($"{gameObject} GhostCaught");
if (gameState == PacManGameState.AttractMode)
{
TimeSequenceSkipToNextStep();
@@ -218,11 +258,11 @@ namespace Marro.PacManUdon
AddScore(scoreBonus);
StartTimeSequence(PacManTimeSequence.GhostCaught);
pacMan.HideUntilUnfrozen();
}
public void PacManCaught()
{
return;
StartTimeSequence(PacManTimeSequence.PacManCaught);
}
@@ -238,8 +278,6 @@ namespace Marro.PacManUdon
public void Intermission2PoleUpdate()
{
//Debug.Log($"{gameObject} Intermission2PoleUpdate");
TimeSequenceSkipToNextStep();
}
@@ -263,11 +301,12 @@ namespace Marro.PacManUdon
statusDisplay.SetLevelDisplayVisible(false);
statusDisplay.SetPlayer1TextVisible(false);
statusDisplay.SetReadyTextVisible(false);
demo.gameObject.SetActive(false);
}
void SetPelletsActive(bool active)
{
collisionManager.gameObject.SetActive(active);
pelletPool.gameObject.SetActive(active);
}
void SetMazeVisible(bool visible)
@@ -299,6 +338,10 @@ namespace Marro.PacManUdon
{
// Debug.Log($"{gameObject} State transitioning from {gameState} to {newGameState}");
gameState = newGameState;
if (Networking.IsOwner(gameObject))
{
RequestSerialization();
}
}
private void IncrementLevel()
@@ -328,6 +371,7 @@ namespace Marro.PacManUdon
}
SetScore(this.score + score);
RequestSerialization();
}
void SetScore(int score)
@@ -349,12 +393,20 @@ namespace Marro.PacManUdon
public void DecrementLives()
{
if (!Networking.IsOwner(gameObject))
{
return;
}
// Debug.Log($"{gameObject} Decremented lives from {extraLives} to {extraLives - 1}");
SetExtraLives(extraLives - 1);
}
void IncrementLives()
{
if (!Networking.IsOwner(gameObject))
{
return;
}
// Debug.Log($"{gameObject} Incremented lives from {extraLives} to {extraLives + 1}");
SetExtraLives(extraLives + 1);
}
@@ -372,121 +424,79 @@ 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);
collisionManager.SetFrozen(frozen);
if (!frozen)
{
pelletManager.SetPowerPelletsBlink(true);
}
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
void TakeOwnership()
{
if (eventType != NetworkEventType.FullSync)
{
return;
}
data.Append(gameState == PacManGameState.InGame, ref index);
data.AppendAsByte(level, ref index);
data.Append(score, ref index);
data.AppendAsByte(extraLives, ref index);
data.Append(currentlyInTimeSequence, ref index);
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);
Networking.SetOwner(Networking.LocalPlayer, gameObject);
Networking.SetOwner(Networking.LocalPlayer, pacMan.gameObject);
Networking.SetOwner(Networking.LocalPlayer, pelletPool.gameObject);
ghostManager.SetOwner(Networking.LocalPlayer);
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
public int ExtraLives
{
if (eventType == NetworkEventType.StartGameButtonPressed)
set
{
StartGameButtonPressed();
return true;
SetExtraLives(value);
}
if (eventType != NetworkEventType.FullSync)
{
return true;
}
// If we're currently in-game, we'll need to make sure the state is setup correctly
var remoteCurrentlyInGame = data.ReadBool(ref index);
if (remoteCurrentlyInGame)
{
currentlyInTimeSequence = false; // Kill the current time sequence, otherwise it might interfere
// No need to run it to completion since we're overriding all state
SetupInGameState();
}
SetLevel(data.ReadByte(ref index));
SetScore(data.ReadInt(ref index));
SetExtraLives(data.ReadByte(ref index));
// Sync up with the remote's time sequence
var remoteCurrentlyInTimeSequence = data.ReadBool(ref index);
if (remoteCurrentlyInTimeSequence)
{
var currentTimeSequence = (PacManTimeSequence)data.ReadByte(ref index);
var 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;
get => extraLives;
}
public PacManGameState GameState => gameState;
public PacManGameState GameState
{
set
{
SetGameState(value);
}
get => gameState;
}
public int Level => level;
public bool GhostsScared
{
set
{
}
get => GhostsScared;
}
public int Score
{
set
{
SetScore(value);
}
get => score;
}
public int HighScore
{
set
{
SetHighScore(value);
}
get => score;
}
public int Level
{
set
{
SetLevel(value);
}
get => level;
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,18 @@
using System;
using UnityEngine;
using VRC.SDK3.Data;
namespace Marro.PacManUdon
namespace Marro.PacManUdon
{
public class GhostManager : SyncedObject
using System;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using VRC.SDK3.Data;
public class GhostManager : UdonSharpBehaviour
{
[NonSerialized] public GameManager gameController;
private Ghost[] ghosts;
private Ghost blinky;
private CollisionManager collisionManager;
// Level constants
private float speedDefault;
private float speedScared;
@@ -24,58 +24,60 @@ namespace Marro.PacManUdon
private int elroy1PelletCount;
private int elroy2PelletCount;
private float powerPelletDuration;
private float[] scatterPattern;
private float pelletTimeoutLimit;
// Power Pellet logic
private bool powerPelletActive;
private float powerPelletDuration;
private float powerPelletCountdown;
private int powerPelletMultiplier;
private DataList ghostScaredQueue;
// Blink logic
private const float blinkCycleRate = 0.233333333f;
private float blinkCycleRate = 0.233333333f;
private bool blinkingActivated;
private float blinkCountdown;
private bool blinkCurrentlyWhite;
// Scattering logic
private float scatterCounter;
private float[] scatterPattern;
private int scatterPatternIndex;
// Elroy logic
public int elroyLevel;
private int pelletsRemaining;
// Ghost house logic
private bool sharedPelletCounterActive;
private int sharedPelletCounter;
private readonly int[] sharedPelletCounterReleaseValues = { 0, 7, 17, 32 };
private int[] sharedPelletCounterReleaseValues = { 0, 7, 17, 32 };
private float pelletTimeout;
private float pelletTimeoutLimit;
private bool frozen;
private bool kinematic;
public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, CollisionManager collisionManager, GameManager gameController)
// This should be called once when the game is initialized
public void Initialize(GameObject[] ghostTargets, PacMan pacMan, GameManager gameController)
{
this.gameController = gameController;
this.collisionManager = collisionManager;
ghosts = transform.GetComponentsInChildren<Ghost>(true);
blinky = ghosts[0];
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{
Transform startTransform = ghostStarts[ghostIndex];
Vector2 homePosition = ghostTargets[0].localPosition;
Vector2 idlePosition1 = ghostTargets[1 + ghostIndex * 3].localPosition;
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition;
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition;
Vector2 homePosition = ghostTargets[0].transform.localPosition;
Vector2 idlePosition1 = ghostTargets[1 + ghostIndex * 3].transform.localPosition;
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].transform.localPosition;
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].transform.localPosition;
ghosts[ghostIndex].Initialize(collisionManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex);
ghosts[ghostIndex].Initialize(pacMan, blinky, homePosition, idlePosition1, idlePosition2, cornerPosition);
}
}
public void RestartLevel(bool afterLifeLost = false)
// This should be called every time the level is reset
public void Reset()
{
ghostScaredQueue = new DataList();
powerPelletActive = false;
scatterCounter = 0;
scatterPatternIndex = 0;
@@ -84,28 +86,32 @@ namespace Marro.PacManUdon
elroyLevel = 0;
kinematic = false;
if (afterLifeLost)
{
SetSharedPelletCounterActive(true);
}
foreach (var ghost in ghosts)
foreach (Ghost ghost in ghosts)
{
ghost.Reset();
}
SetScattering(true, reverseDirection: false);
RequestSerialization();
}
public void NewLevel()
{
SetSharedPelletCounterActive(false);
UpdateElroyLevel(collisionManager.PelletCount);
foreach (Ghost ghost in ghosts)
{
ghost.ResetHousePelletCounter();
}
}
public override void SyncedUpdate()
public void LifeLost()
{
SetSharedPelletCounterActive(true);
}
public void FixedUpdate()
{
// gameStateManager.statusDisplay.SetDebugText(1, this.blinkCountdown.ToString());
if (frozen || kinematic)
{
return;
@@ -125,7 +131,7 @@ namespace Marro.PacManUdon
void UpdateScattering()
{
scatterCounter += networkManager.SyncedDeltaTime;
scatterCounter += Time.deltaTime;
if (scatterPatternIndex < scatterPattern.Length && scatterCounter >= scatterPattern[scatterPatternIndex])
{
// Debug.Log($"{gameObject} SetScattering: {scatterPatternIndex%1 == 0}, scatterCounter: {scatterCounter}, scatterPattern: {scatterPattern[scatterPatternIndex]}, scatterPatternIndex: {scatterPatternIndex}");
@@ -136,7 +142,7 @@ namespace Marro.PacManUdon
void UpdatePowerPellet()
{
powerPelletCountdown -= networkManager.SyncedDeltaTime;
powerPelletCountdown -= Time.deltaTime;
if (powerPelletCountdown <= 0)
{
gameController.EndPowerPellet(); // End power pellet
@@ -149,7 +155,7 @@ namespace Marro.PacManUdon
if (blinkingActivated)
{
blinkCountdown -= networkManager.SyncedDeltaTime;
blinkCountdown -= Time.deltaTime;
if (blinkCountdown <= 0)
{
blinkCountdown += blinkCycleRate;
@@ -160,15 +166,14 @@ namespace Marro.PacManUdon
void UpdatePelletTimeout()
{
pelletTimeout += networkManager.SyncedDeltaTime;
pelletTimeout += Time.deltaTime;
if (pelletTimeout >= pelletTimeoutLimit)
{
pelletTimeout -= pelletTimeoutLimit;
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{
var ghost = ghosts[ghostIndex];
Ghost ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home)
{
ghost.Release();
@@ -178,14 +183,38 @@ namespace Marro.PacManUdon
}
}
public void GhostCaught(Ghost ghost)
public void GhostCaughtQueue(Ghost ghost)
{
if (gameController.GameState == PacManGameState.AttractMode)
{
gameController.GhostCaught(0);
return;
}
// Debug.Log($"{gameObject} GhostCaughtQueue with ghost {ghost}");
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);
@@ -241,7 +270,7 @@ namespace Marro.PacManUdon
void SetGhostBlinkingState(bool white)
{
blinkCurrentlyWhite = white;
foreach (var ghost in ghosts)
foreach (Ghost ghost in ghosts)
{
ghost.SetWhite(white);
}
@@ -256,7 +285,7 @@ namespace Marro.PacManUdon
powerPelletCountdown = powerPelletDuration;
powerPelletMultiplier = 0;
SetGhostBlinking(false);
foreach (var ghost in ghosts)
foreach (Ghost ghost in ghosts)
{
ghost.BecomeScared();
}
@@ -274,7 +303,7 @@ namespace Marro.PacManUdon
public void SetFrozen(bool frozen, bool ignoreIfCaught = false)
{
this.frozen = frozen;
foreach (var ghost in ghosts)
foreach (Ghost ghost in ghosts)
{
ghost.SetFrozen(frozen, ignoreIfCaught: ignoreIfCaught);
}
@@ -282,19 +311,7 @@ namespace Marro.PacManUdon
public void SetLevel(int level)
{
//Debug.Log($"GhostManager: SetLevel {level}");
SetLevelConstants(level);
int[] privatePelletCounterReleaseValues = PacManConstants.GetGhostHousePrivatePelletCounterLimitForLevel(level);
for (int i = 0; i < ghosts.Length; i++)
{
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
ghosts[i].UpdateSpeed();
}
}
private void SetLevelConstants(int level)
{
Debug.Log($"GhostManager: SetLevel {level}");
speedDefault = PacManConstants.GetGhostDefaultSpeedForLevel(level);
speedScared = PacManConstants.GetGhostScaredSpeedForLevel(level);
speedReturn = 15f;
@@ -307,6 +324,22 @@ namespace Marro.PacManUdon
powerPelletDuration = PacManConstants.GetScaredDurationForLevel(level);
scatterPattern = PacManConstants.GetScatterPatternForLevel(level);
pelletTimeoutLimit = PacManConstants.GetGhostHousePelletTimeoutLimitForLevel(level);
int[] privatePelletCounterReleaseValues = PacManConstants.GetGhostHousePrivatePelletCounterLimitForLevel(level);
for (int i = 0; i < ghosts.Length; i++)
{
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
ghosts[i].Reset(); // Reset needed to properly apply level
}
}
public void SetOwner(VRCPlayerApi player)
{
Networking.SetOwner(player, gameObject);
foreach (Ghost ghost in ghosts)
{
Networking.SetOwner(player, ghost.gameObject);
}
}
public float GetTargetSpeed(Ghost ghost, PacManGhostState ghostState, bool isScared, bool inTunnel)
@@ -343,10 +376,10 @@ namespace Marro.PacManUdon
void SetScattering(bool scattering, bool reverseDirection = true)
{
//Debug.Log($"{gameObject} SetScattering: {scattering}");
foreach (var ghost in ghosts)
Debug.Log($"{gameObject} SetScattering: {scattering}");
foreach (Ghost ghost in ghosts)
{
if (ghost == blinky && elroyLevel > 0) // Once blinky is elroy he no longer scatters
if (ghost == blinky && pelletsRemaining <= elroy1PelletCount)
{
continue;
}
@@ -354,25 +387,27 @@ namespace Marro.PacManUdon
}
}
/// <summary>
/// Whether to use the shared pellet counter for ghost exiting.
/// Should be called before ghosts are reset.
/// </summary>
public void SetPelletsRemaining(int pelletsRemaining)
{
this.pelletsRemaining = pelletsRemaining;
UpdateElroyLevel();
}
void SetSharedPelletCounterActive(bool active)
{
//Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}");
// Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}");
sharedPelletCounterActive = active;
foreach (var ghost in ghosts)
foreach (Ghost ghost in ghosts)
{
ghost.SetHousePelletCounterActive(!active);
}
}
public void PelletConsumed(int pelletsRemainingCount)
public void PelletConsumed()
{
pelletTimeout = 0;
SetPelletsRemaining(pelletsRemaining - 1);
UpdateElroyLevel(pelletsRemainingCount);
pelletTimeout = 0;
if (sharedPelletCounterActive)
{
@@ -387,10 +422,9 @@ namespace Marro.PacManUdon
void IncrementSharedPelletCounter()
{
sharedPelletCounter++;
//Debug.Log($"Incremented shared pellet counter to {sharedPelletCounter}");
for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++)
{
var ghost = ghosts[ghostIndex];
Ghost ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home && sharedPelletCounter == sharedPelletCounterReleaseValues[ghostIndex])
{
ghost.Release();
@@ -407,7 +441,7 @@ namespace Marro.PacManUdon
{
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{
var ghost = ghosts[ghostIndex];
Ghost ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home)
{
ghost.IncrementHousePelletCounter();
@@ -416,15 +450,13 @@ namespace Marro.PacManUdon
}
}
void UpdateElroyLevel(int pelletsRemainingCount)
void UpdateElroyLevel()
{
// Debug.Log($"{gameObject} Updating Elroy Level with pelletsRemaining {pelletsRemaining} with elroy2PelletCount {elroy2PelletCount} and elroy1PelletCount {elroy1PelletCount}");
var oldElroyLevel = elroyLevel;
if (pelletsRemainingCount < elroy2PelletCount) elroyLevel = 2;
else if (pelletsRemainingCount < elroy1PelletCount) elroyLevel = 1;
int oldElroyLevel = elroyLevel;
if (pelletsRemaining < elroy2PelletCount) elroyLevel = 2;
else if (pelletsRemaining < elroy1PelletCount) elroyLevel = 1;
else elroyLevel = 0;
if (elroyLevel != oldElroyLevel)
{
blinky.SetElroy(elroyLevel);
@@ -434,7 +466,7 @@ namespace Marro.PacManUdon
public void SetActive(bool active)
{
gameObject.SetActive(active);
foreach (var ghost in ghosts)
foreach (Ghost ghost in ghosts)
{
ghost.SetActive(active);
}
@@ -443,85 +475,12 @@ namespace Marro.PacManUdon
public void SetKinematic(bool kinematic)
{
this.kinematic = kinematic;
foreach (var ghost in ghosts)
foreach (Ghost ghost in ghosts)
{
ghost.SetKinematic(kinematic);
}
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
// Power Pellet logic
data.Append(powerPelletActive, ref index);
data.Append(powerPelletCountdown, ref index);
data.AppendAsByte(powerPelletMultiplier, ref index);
// Blink logic
data.Append(blinkingActivated, ref index);
data.Append(blinkCountdown, ref index);
data.Append(blinkCurrentlyWhite, ref index);
// Scattering logic
data.Append(scatterCounter, ref index);
data.AppendAsByte(scatterPatternIndex, ref index);
// Elroy logic
data.AppendAsByte(elroyLevel, ref index);
// Ghost house logic
data.Append(sharedPelletCounterActive, ref index);
data.AppendAsByte(sharedPelletCounter, ref index);
data.Append(pelletTimeout, ref index);
data.Append(frozen, ref index);
data.Append(kinematic, ref index);
data.AppendAsByte(gameController.Level, ref index);
foreach (var ghost in ghosts)
{
ghost.CollectSyncedData(data, ref index, eventType);
}
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
// Power Pellet logic
powerPelletActive = data.ReadBool(ref index);
powerPelletCountdown = data.ReadFloat(ref index);
powerPelletMultiplier = data.ReadByte(ref index);
// Blink logic
blinkingActivated = data.ReadBool(ref index);
blinkCountdown = data.ReadFloat(ref index);
blinkCurrentlyWhite = data.ReadBool(ref index);
// Scattering logic
scatterCounter = data.ReadFloat(ref index);
scatterPatternIndex = data.ReadByte(ref index);
// Elroy logic
elroyLevel = data.ReadByte(ref index);
// Ghost house logic
sharedPelletCounterActive = data.ReadBool(ref index);
sharedPelletCounter = data.ReadByte(ref index);
pelletTimeout = data.ReadFloat(ref index);
frozen = data.ReadBool(ref index);
kinematic = data.ReadBool(ref index);
var level = data.ReadByte(ref index);
SetLevelConstants(level);
foreach (var ghost in ghosts)
{
ghost.WriteSyncedData(data, ref index, eventType);
}
return true;
}
public Ghost[] Ghosts
{
get => ghosts;

View File

@@ -1,213 +1,26 @@
namespace Marro.PacManUdon
{
using System;
using UdonSharp;
using UnityEngine;
public enum Direction
public abstract class GridMover : UdonSharpBehaviour
{
Zero = 0, Up = 1, Down = 2, Left = 4, Right = 8, UpLeft = 5, UpRight = 9, DownLeft = 6, DownRight = 10
}
public enum DirectionAxis
{
Horizontal = 0,
Vertical = 1,
Both = 2
}
public abstract class GridMover : SyncedObject
{
protected Vector2 position;
protected Direction direction;
protected Direction targetDirection;
// Cannot be static
public readonly Vector2[] directionVectors =
{
Vector2.zero, // 0
Vector2.up, // 1
Vector2.down, // 2
Vector2.zero, // 3
Vector2.left, // 4
Vector2.up + Vector2.left, // 5
Vector2.down + Vector2.left, // 6
Vector2.left, // 7
Vector2.right, // 8
Vector2.up + Vector2.right, // 9
Vector2.down + Vector2.right, // 10
Vector2.right, // 11
Vector2.zero, // 12
Vector2.up, // 13
Vector2.down, // 14
Vector2.zero, // 15
};
public virtual Vector2 GetPosition()
{
//return (Vector2)transform.localPosition;
return position;
Debug.LogError($"{gameObject} does not implement GetPosition");
return Vector2.zero;
}
public virtual void SetPosition(Vector2 position)
{
this.position = position;
transform.localPosition = new Vector3(position.x, position.y, transform.localPosition.z);
Debug.LogError($"{gameObject} does not implement SetPosition");
}
public Direction GetDirection()
public virtual Vector2 GetDirection()
{
return direction;
Debug.LogError($"{gameObject} does not implement GetDirection");
return Vector2.zero;
}
public Direction GetTargetDirection()
{
return targetDirection;
}
public void SetDirection(Direction direction)
{
this.direction = direction;
UpdateAnimator();
}
protected void SetTargetDirection(Direction targetDirection)
{
this.targetDirection = targetDirection;
UpdateAnimator();
}
public void SetDirectionAndTargetDirection(Direction direction)
{
this.direction = direction;
this.targetDirection = direction;
UpdateAnimator();
}
protected static Direction HorizontalToDirection(float horizontal)
{
if (horizontal < 0)
{
return Direction.Left;
}
if (horizontal > 0)
{
return Direction.Right;
}
return Direction.Zero;
}
protected static Direction VerticalToDirection(float vertical)
{
if (vertical < 0)
{
return Direction.Down;
}
if (vertical > 0)
{
return Direction.Up;
}
return Direction.Zero;
}
protected abstract void UpdateAnimator();
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
data.Append(GetPosition(), ref index);
data.AppendAsByte((int)direction, ref index);
data.AppendAsByte((int)targetDirection, ref index);
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
SetPosition(data.ReadVector2(ref index));
direction = (Direction)data.ReadByte(ref index);
targetDirection = (Direction)data.ReadByte(ref index);
UpdateAnimator();
return true;
}
public void PadSyncedData(ref int index)
{
index += 10;
}
#region Utils
public static Direction GetInverseDirection(Direction direction)
{
switch (direction)
{
case Direction.Up:
return Direction.Down;
case Direction.Down:
return Direction.Up;
case Direction.Left:
return Direction.Right;
case Direction.Right:
return Direction.Left;
case Direction.UpLeft:
return Direction.DownRight;
case Direction.UpRight:
return Direction.DownLeft;
case Direction.DownLeft:
return Direction.UpRight;
case Direction.DownRight:
return Direction.UpLeft;
default:
return Direction.Zero;
}
}
public static bool IsVertical(Direction direction) => ((int)direction & 0b0011) != 0;
public static bool IsHorizontal(Direction direction) => ((int)direction & 0b1100) != 0;
public static Direction VerticalComponent(Direction direction) => (Direction)((int)direction & 0b0011);
public static Direction HorizontalComponent(Direction direction) => (Direction)((int)direction & 0b1100);
public static Vector2 GetNextPosition(Vector2 currentPosition, Vector2 directionVector, float speed, float deltaTime)
{
var nextPosition = currentPosition + deltaTime * speed * directionVector;
nextPosition = new Vector2((nextPosition.x + 32) % 32, (nextPosition.y + 32) % 32);
return nextPosition;
}
public static Vector2 PositionToGrid(Vector2 position)
{
return new Vector2((int)position.x + 0.5f, (int)position.y + 0.5f);
}
public static bool CrossesTileBorder(Vector2 currentPosition, Vector2 nextPosition, Direction direction)
{
bool result = false;
if (IsHorizontal(direction))
{
result = Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x);
}
if (!result && IsVertical(direction))
{
result = Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y);
}
return result;
}
public static bool CrossesTileCenter(Vector2 currentPosition, Vector2 nextPosition, Direction direction)
{
bool result = false;
if (IsHorizontal(direction))
{
result = Math.Round(currentPosition.x) != Math.Round(nextPosition.x);
}
if (!result && IsVertical(direction))
{
result = Math.Round(currentPosition.y) != Math.Round(nextPosition.y);
}
return result;
}
#endregion
}
}

View File

@@ -0,0 +1,70 @@
namespace Marro.PacManUdon
{
using System;
using UnityEngine;
public static class GridMoverTools
{
public static Vector2 GetNextPosition(Vector2 currentPosition, Vector2 direction, float speed)
{
return currentPosition + direction * speed * Time.deltaTime;
}
public static void SetPosition(Vector2 position, Transform transform)
{
transform.localPosition = new Vector3(position.x, position.y, transform.localPosition.z);
}
public static Vector2 PositionToGrid(Vector2 position)
{
return new Vector2((float)Math.Round(position.x), (float)Math.Round(position.y));
}
public static bool CrossesTileCenter(Vector2 currentPosition, Vector2 nextPosition, bool horizontal, bool vertical)
{
bool result = false;
if (horizontal)
{
result = result || Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x);
}
if (vertical)
{
result = result || Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y);
}
// Debug.Log($"CrossesTileCenter at currentPosition {currentPosition} with nextPosition {nextPosition}, horizontal {horizontal} and vertical {vertical} gives {result}");
return result;
}
public static bool CrossesTileBorder(Vector2 currentPosition, Vector2 nextPosition, bool horizontal, bool vertical)
{
bool result = false;
if (horizontal)
{
result = result || nextPosition.x != currentPosition.x
&& ((Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x) && nextPosition.x % 1 != 0)
|| currentPosition.x % 1 == 0);
}
if (vertical)
{
result = result || nextPosition.y != currentPosition.y
&& ((Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y) && nextPosition.y % 1 != 0)
|| currentPosition.y % 1 == 0);
}
return result;
}
public static bool CheckCollisionInDirection(Transform transform, Vector2 position, Vector2 direction)
{
// Debug.Log("Collision check");
bool result = Physics.Linecast(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), 1 << 22, QueryTriggerInteraction.Ignore);
// Debug.DrawLine(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), Color.red, 1);
// Debug.Log($"{gameObject} Collision; Position {position} became {transform.parent.TransformPoint(position)}, direction {direction.normalized} became {transform.parent.TransformDirection(direction.normalized)}");
// Debug.Log("collision check for " + position + " in direction " + direction + " returned " + result);
return result;
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7d2126e683a87e241ad0399cefcda807
guid: f317309f5509067439e01d1111249555
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -43,37 +43,31 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 5
Data: 4
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: networkManager
Data: _animator
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager
Data: _animator
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, Assembly-CSharp
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- 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:
Entry: 9
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -85,10 +79,10 @@ MonoBehaviour:
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -109,25 +103,31 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _animator
Data: _gameManager
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _animator
Data: _gameManager
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
Data: 6|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Entry: 7
Data: 7|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
@@ -163,25 +163,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _gameManager
Data: _ghost
- Name: $v
Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _gameManager
Data: _ghost
- Name: <UserType>k__BackingField
Entry: 7
Data: 10|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
Data: Marro.PacManUdon.Ghost, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -217,70 +217,16 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _ghost
Data: _lastUpdate
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ghost
Data: _lastUpdate
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Ghost, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _lastUpdate
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _lastUpdate
- Name: <UserType>k__BackingField
Entry: 7
Data: 16|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.PoleStrechLevels, Assembly-CSharp
@@ -289,7 +235,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 17|System.RuntimeType, mscorlib
Data: 14|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
@@ -310,7 +256,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 18|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

View File

@@ -2,7 +2,6 @@
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using static Cinemachine.DocumentationSortingAttribute;
namespace Marro.PacManUdon
{
@@ -16,7 +15,7 @@ namespace Marro.PacManUdon
}
[RequireComponent(typeof(Animator))]
public class Intermission2Pole : SyncedObject
public class Intermission2Pole : UdonSharpBehaviour
{
Animator _animator;
@@ -35,7 +34,6 @@ namespace Marro.PacManUdon
_ghost = ghost;
_gameManager = gameManager;
_animator = GetComponent<Animator>();
SetActive(false); // Should only activate for intermission 2
Reset();
}
@@ -45,13 +43,7 @@ namespace Marro.PacManUdon
SetStrechLevel(PoleStrechLevels.None);
}
public void SetActive(bool isActive)
{
//Debug.Log($"({nameof(PacManUdon)} {nameof(Intermission2Pole)}) SetActive {isActive}.");
gameObject.SetActive(isActive);
}
public override void SyncedUpdate()
public void FixedUpdate()
{
if (!_ghost.gameObject.activeInHierarchy)
{
@@ -115,7 +107,6 @@ namespace Marro.PacManUdon
public void SetStrechLevel(PoleStrechLevels level)
{
//Debug.Log($"({nameof(PacManUdon)} {nameof(Intermission2Pole)}) Set strech level to {level}.");
_animator.SetFloat("Strech", GetAnimatorValueForStrechLevel(level));
}

View File

@@ -43,7 +43,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 6
Data: 4
- Name:
Entry: 7
Data:
@@ -109,19 +109,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: pelletContainer
Data: ghostTargets
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pelletContainer
Data: ghostTargets
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject, UnityEngine.CoreModule
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -169,19 +169,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: mazeSprite
Data: pelletContainer
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: mazeSprite
Data: pelletContainer
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
Entry: 7
Data: 11|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -196,13 +202,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 12|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 13|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -223,25 +229,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: ghostTargets
Data: mazeSprite
- Name: $v
Entry: 7
Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ghostTargets
Data: mazeSprite
- Name: <UserType>k__BackingField
Entry: 7
Data: 14|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Transform[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
Entry: 9
Data: 11
- Name: <SystemType>k__BackingField
Entry: 9
Data: 14
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -278,120 +278,6 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: ghostStarts
- Name: $v
Entry: 7
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ghostStarts
- Name: <UserType>k__BackingField
Entry: 9
Data: 14
- Name: <SystemType>k__BackingField
Entry: 9
Data: 14
- 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: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 19|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: pacManStart
- Name: $v
Entry: 7
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pacManStart
- Name: <UserType>k__BackingField
Entry: 7
Data: 21|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Transform, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 21
- 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: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 23|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:

View File

@@ -1,15 +1,15 @@
using UdonSharp;
using UnityEngine;
namespace Marro.PacManUdon
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class Maze : UdonSharpBehaviour
{
[SerializeField] public Vector2 mazeBoundaries;
[SerializeField] public GameObject[] ghostTargets;
[SerializeField] public GameObject pelletContainer;
[SerializeField] public GameObject mazeSprite;
[SerializeField] public Transform[] ghostTargets;
[SerializeField] public Transform[] ghostStarts;
[SerializeField] public Transform pacManStart;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -49,19 +49,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: networkManager
Data: gameController
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager
Data: gameController
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, Assembly-CSharp
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name:
Entry: 8
Data:
@@ -85,7 +85,7 @@ MonoBehaviour:
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
@@ -109,25 +109,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: position
Data: input
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: position
Data: input
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector2, UnityEngine.CoreModule
Data: Marro.PacManUdon.PlayerInput, 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,31 +163,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: direction
Data: defaultSpeed
- Name: $v
Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: direction
Data: defaultSpeed
- Name: <UserType>k__BackingField
Entry: 7
Data: 10|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Direction, Assembly-CSharp
Data: System.Single, mscorlib
- 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: 10
- 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,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: targetDirection
Data: powerPelletSpeed
- 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: targetDirection
Data: powerPelletSpeed
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 10
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -250,7 +244,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -271,25 +265,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: directionVectors
Data: speed
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: directionVectors
Data: speed
- Name: <UserType>k__BackingField
Entry: 7
Data: 16|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector2[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 16
Data: 10
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -304,7 +292,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 17|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
@@ -325,25 +313,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: input
Data: startPosition
- Name: $v
Entry: 7
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: input
Data: startPosition
- Name: <UserType>k__BackingField
Entry: 7
Data: 19|System.RuntimeType, mscorlib
Data: 17|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.PlayerInput, Assembly-CSharp
Data: UnityEngine.Vector3, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Data: 17
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -358,7 +346,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 20|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
@@ -379,25 +367,73 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: collisionManager
Data: startRotation
- Name: $v
Entry: 7
Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: collisionManager
Data: startRotation
- Name: <UserType>k__BackingField
Entry: 7
Data: 22|System.RuntimeType, mscorlib
Data: 20|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.CollisionManager, Assembly-CSharp
Data: UnityEngine.Quaternion, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Data: 20
- 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: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: startScale
- Name: $v
Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: startScale
- Name: <UserType>k__BackingField
Entry: 9
Data: 17
- Name: <SystemType>k__BackingField
Entry: 9
Data: 17
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -541,19 +577,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: startPosition
Data: pelletPool
- Name: $v
Entry: 7
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: startPosition
Data: pelletPool
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
Entry: 7
Data: 31|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Components.VRCObjectPool, VRCSDK3
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 31
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -568,7 +610,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -589,25 +631,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: defaultSpeed
Data: hideUntilUnfrozen
- Name: $v
Entry: 7
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: defaultSpeed
Data: hideUntilUnfrozen
- Name: <UserType>k__BackingField
Entry: 7
Data: 33|System.RuntimeType, mscorlib
Data: 34|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -622,7 +664,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 34|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
@@ -643,19 +685,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: powerPelletSpeed
Data: dead
- Name: $v
Entry: 7
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletSpeed
Data: dead
- Name: <UserType>k__BackingField
Entry: 9
Data: 33
Data: 34
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -670,7 +712,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -691,25 +733,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: state
Data: kinematic
- Name: $v
Entry: 7
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: state
Data: kinematic
- Name: <UserType>k__BackingField
Entry: 7
Data: 38|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.PacManState, Assembly-CSharp
- Name:
Entry: 8
Data:
Entry: 9
Data: 34
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -745,19 +781,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: speed
Data: followingPredefinedPath
- Name: $v
Entry: 7
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: speed
Data: followingPredefinedPath
- Name: <UserType>k__BackingField
Entry: 9
Data: 33
Data: 34
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -793,19 +829,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: freezeSeconds
Data: predefinedPath
- Name: $v
Entry: 7
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: freezeSeconds
Data: predefinedPath
- Name: <UserType>k__BackingField
Entry: 9
Data: 33
Entry: 7
Data: 43|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector2[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
Data: 43
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -820,7 +862,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 43|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -841,25 +883,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: frozen
Data: predefinedPathIndex
- Name: $v
Entry: 7
Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: frozen
Data: predefinedPathIndex
- Name: <UserType>k__BackingField
Entry: 7
Data: 45|System.RuntimeType, mscorlib
Data: 46|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 45
Data: 46
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -874,7 +916,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -895,73 +937,31 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: kinematic
Data: syncedPosition
- Name: $v
Entry: 7
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: kinematic
Data: syncedPosition
- Name: <UserType>k__BackingField
Entry: 9
Data: 45
Entry: 7
Data: 49|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 45
Data: 49
- 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: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: followingPredefinedPath
- Name: $v
Entry: 7
Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: followingPredefinedPath
- Name: <UserType>k__BackingField
Entry: 9
Data: 45
- Name: <SystemType>k__BackingField
Entry: 9
Data: 45
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -973,7 +973,13 @@ MonoBehaviour:
Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 51|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -991,37 +997,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: predefinedPath
Data: targetDirection
- Name: $v
Entry: 7
Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: predefinedPath
Data: targetDirection
- Name: <UserType>k__BackingField
Entry: 7
Data: 52|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.Direction[], Assembly-CSharp
- Name:
Entry: 8
Data:
Entry: 9
Data: 49
- Name: <SystemType>k__BackingField
Entry: 7
Data: 53|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32[], mscorlib
- Name:
Entry: 8
Data:
Entry: 9
Data: 49
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -1030,10 +1024,16 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 53|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 54|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -1051,25 +1051,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: predefinedPathIndex
Data: direction
- Name: $v
Entry: 7
Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: predefinedPathIndex
Data: direction
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 49
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 49
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -1081,7 +1081,13 @@ MonoBehaviour:
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 57|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -1099,25 +1105,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: animatorKeyState
Data: freezeSeconds
- Name: $v
Entry: 7
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: animatorKeyState
Data: freezeSeconds
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 10
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -1126,10 +1132,16 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 58|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
Data: 1
- Name:
Entry: 7
Data: 60|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -1147,25 +1159,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: animatorKeyDirection
Data: frozen
- Name: $v
Entry: 7
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: animatorKeyDirection
Data: frozen
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 34
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -1174,10 +1186,16 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 63|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:

View File

@@ -1,78 +1,82 @@
using UnityEngine;
namespace Marro.PacManUdon
namespace Marro.PacManUdon
{
enum PacManAnimatorState
{
Idle,
Moving,
Stopped,
Big,
Dead,
}
using System;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using VRC.SDK3.Components;
enum PacManState
{
Idle,
Normal,
PowerPellet,
Dead,
Big,
}
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Renderer))]
public class PacMan : GridMover
{
private GameManager gameController;
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 float freezeSeconds;
private bool frozen;
private Vector3 startPosition;
private Quaternion startRotation;
private Vector3 startScale;
private Animator animator;
new Renderer renderer;
private VRCObjectPool pelletPool;
private bool hideUntilUnfrozen;
private bool dead;
private bool kinematic;
private bool followingPredefinedPath;
private Direction[] predefinedPath;
private Vector2[] predefinedPath;
private int predefinedPathIndex;
private readonly int animatorKeyState = Animator.StringToHash("State");
private readonly int animatorKeyDirection = Animator.StringToHash("Direction");
[UdonSynced] private Vector2 syncedPosition;
[UdonSynced] private Vector2 targetDirection;
[UdonSynced] private Vector2 direction;
[UdonSynced] private float freezeSeconds;
[UdonSynced] private bool frozen;
public void Initialize(PlayerInput input, Transform startTransform, GameManager gameManager, CollisionManager collisionManager)
#region Animator constants
private const string AnimatorKeyDead = "Dead";
private const string AnimatorKeyDirection = "Direction";
private const float AnimatorDirectionNone = 0f;
private const float AnimatorDirectionRight = 0.25f;
private const float AnimatorDirectionLeft = 0.50f;
private const float AnimatorDirectionUp = 0.75f;
private const float AnimatorDirectionDown = 1f;
private const float AnimatorDirectionRightBig = 1.25f;
#endregion
public void Initialize(PlayerInput input, VRCObjectPool pelletPool, GameManager gameController)
{
this.collisionManager = collisionManager;
this.gameController = gameController;
this.input = input;
this.pelletPool = pelletPool;
animator = GetComponent<Animator>();
renderer = GetComponent<Renderer>();
frozen = false;
startPosition = startTransform.localPosition;
hideUntilUnfrozen = false;
startPosition = transform.localPosition;
startRotation = transform.localRotation;
startScale = transform.localScale;
}
public void Reset()
{
SetPosition(startPosition);
direction = Direction.Left;
targetDirection = Direction.Left;
// Debug.Log($"{gameObject} Reset!");
transform.localPosition = startPosition;
transform.localRotation = startRotation;
transform.localScale = startScale;
direction = Vector2.left;
targetDirection = Vector2.left;
speed = defaultSpeed;
kinematic = false;
followingPredefinedPath = false;
state = PacManState.Idle;
UpdateSpeed();
UpdateAnimator();
SetDead(false);
animator.SetTrigger("Reset");
}
public override void SyncedUpdate()
void FixedUpdate()
{
// gameStateManager.statusDisplay.SetDebugText(1, this.targetDirection.ToString());
@@ -81,10 +85,33 @@ namespace Marro.PacManUdon
return;
}
float speed = GetNextSpeed();
if (hideUntilUnfrozen)
{
hideUntilUnfrozen = false;
SetVisibility(true);
}
float speed = this.speed;
if (freezeSeconds > 0)
{
float freezePart = freezeSeconds / Time.deltaTime;
if (freezePart >= 1)
{
freezeSeconds -= Time.deltaTime;
animator.speed = 0;
return;
}
speed *= 1 - freezePart;
animator.speed = 1 - freezePart;
freezeSeconds = 0;
}
else
{
animator.speed = 1;
}
Vector2 position = GetPosition();
Vector2 nextPosition = GetNextPosition(position, directionVectors[(int)direction], speed, networkManager.SyncedDeltaTime); // The position pacman will move to, assuming it doens't get changed
Vector2 nextPosition = GridMoverTools.GetNextPosition(position, direction, speed); // The position pacman will move to, assuming it doens't get changed
if (!kinematic)
{
@@ -98,75 +125,44 @@ namespace Marro.PacManUdon
}
}
if (CrossesTileBorder(position, nextPosition, direction))
{
CheckNewTile(position, nextPosition);
}
SetPosition(nextPosition);
}
private float GetNextSpeed()
{
float speed = this.speed;
if (freezeSeconds > 0)
{
float freezePart = freezeSeconds / networkManager.SyncedDeltaTime;
if (freezePart >= 1)
{
freezeSeconds -= networkManager.SyncedDeltaTime;
animator.speed = 0;
speed = 0;
}
else
{
speed *= 1 - freezePart;
animator.speed = 1 - freezePart;
freezeSeconds = 0;
}
}
else
{
animator.speed = 1;
}
return speed;
}
private Vector2 ProcessNextPosition(Vector2 position, Vector2 nextPosition)
{
if (CrossesTileCenter(position, nextPosition, Direction.Left) // If pacman is moving horizontally, check if he may cross the center of a tile in that axis
&& (!IsHorizontal(targetDirection) || collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)HorizontalComponent(direction)])))
if (GridMoverTools.CrossesTileCenter(position, nextPosition, direction.x != 0, false) // If pacman is moving horizontally, check if he may cross the center of a tile in that axis
&& (targetDirection.x == 0 || GridMoverTools.CheckCollisionInDirection(transform, nextPosition, new Vector2(direction.x, 0))))
{ // If the target direction is in the other axis or if we're about to run into a wall
nextPosition.x = PositionToGrid(nextPosition).x; // Snap pacman to the center of his current tile in this axis
SetDirection(VerticalComponent(direction));
//Debug.Log($"{gameObject} crossed X tile center from {position}, nextPosition is now {nextPosition} and direction is now {direction}");
nextPosition.x = GridMoverTools.PositionToGrid(nextPosition).x; // Snap pacman to the center of his current tile in this axis
SetDirection(new Vector2(0, direction.y));
// Debug.Log($"{gameObject} crossed X tile center from {currentPosition}, nextPosition is now {nextPosition} and direction is now {direction}");
}
if (CrossesTileCenter(position, nextPosition, Direction.Down) // See comments above but now vertical
&& (!IsVertical(targetDirection) || collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)VerticalComponent(direction)])))
if (GridMoverTools.CrossesTileCenter(position, nextPosition, false, direction.y != 0) // See comments above but now vertical
&& (targetDirection.y == 0 || GridMoverTools.CheckCollisionInDirection(transform, nextPosition, new Vector2(0, direction.y))))
{
nextPosition.y = PositionToGrid(nextPosition).y;
SetDirection(HorizontalComponent(direction));
//Debug.Log($"{gameObject} crossed Y tile center from {position} with targetDirection {targetDirection}, nextPosition is now {nextPosition} and direction is now {direction}");
nextPosition.y = GridMoverTools.PositionToGrid(nextPosition).y;
SetDirection(new Vector2(direction.x, 0));
// Debug.Log($"{gameObject} crossed Y tile center from {currentPosition} with targetDirection {targetDirection}, nextPosition is now {nextPosition} and direction is now {direction}");
}
var inputDirection = input.GetDirection();
if (!inputDirection.Equals(Direction.Zero) && !inputDirection.Equals(targetDirection) // Ignore neutral input or input in our current direction
&& !collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)inputDirection])) // Check if the requested direction does not have a wall
if (Networking.IsOwner(gameObject))
{
// Move in the requested direction, as well as perpundicular to it to get to the center of the tunnel
if (IsHorizontal(inputDirection))
{
var directionToCenter = VerticalToDirection(PositionToGrid(nextPosition).y - nextPosition.y);
SetDirection((Direction)((int)inputDirection | (int)directionToCenter));
Vector2 inputDirection = input.GetDirection();
if (!inputDirection.Equals(Vector2.zero) && !inputDirection.Equals(targetDirection) // Ignore neutral input or input in our current direction
&& (inputDirection.x == 0 || (Math.Round(nextPosition.y, 5) - 0.5) % 1 != 0) && (inputDirection.y == 0 || (Math.Round(nextPosition.x, 5) - 0.5) % 1 != 0) // Target grid position near the edge of a tile may not be correct, ignore inputs near the border
&& !GridMoverTools.CheckCollisionInDirection(transform, nextPosition, inputDirection))
{ // Check if the requested direction does not have a wall
if (inputDirection.x != 0)
{ // Move in the requested direction, as well as perpundicular to it to get to the center of the tunnel
SetDirection(inputDirection + new Vector2(0, GridMoverTools.PositionToGrid(nextPosition).y - nextPosition.y).normalized);
}
else
{
SetDirection(inputDirection + new Vector2(GridMoverTools.PositionToGrid(nextPosition).x - nextPosition.x, 0).normalized);
}
SetTargetDirection(inputDirection); // This is the direction most logic should assume pacman is moving, the actual direction may be different due to cornering
}
else
{
var directionToCenter = HorizontalToDirection(PositionToGrid(nextPosition).x - nextPosition.x);
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
}
return nextPosition;
@@ -174,21 +170,22 @@ namespace Marro.PacManUdon
private Vector2 ProcessPredefinedPath(Vector2 position, Vector2 nextPosition)
{
if (CrossesTileCenter(position, nextPosition, direction))
if (GridMoverTools.CrossesTileCenter(position, nextPosition, direction.x != 0, direction.y != 0))
{
// Find the next valid direction which isn't Vector2.zero
int nextValidDirectionIndex = predefinedPathIndex;
while (predefinedPath[nextValidDirectionIndex] == Direction.Zero)
while (predefinedPath[nextValidDirectionIndex] == Vector2.zero)
{
nextValidDirectionIndex += 1;
}
if (!collisionManager.IsWallUpcoming(nextPosition, directionVectors[(int)predefinedPath[nextValidDirectionIndex]]))
if (!GridMoverTools.CheckCollisionInDirection(transform, nextPosition, predefinedPath[nextValidDirectionIndex]))
{
// If we're at a Vector2.zero, we skip applying the direction and only increment.
if (nextValidDirectionIndex == predefinedPathIndex)
{
SetDirectionAndTargetDirection(predefinedPath[nextValidDirectionIndex]);
nextPosition = PositionToGrid(nextPosition) + directionVectors[(int)direction] * 0.01f;
SetDirection(predefinedPath[nextValidDirectionIndex]);
SetTargetDirection(predefinedPath[nextValidDirectionIndex]);
nextPosition = GridMoverTools.PositionToGrid(nextPosition) + direction.normalized * 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
@@ -199,7 +196,7 @@ namespace Marro.PacManUdon
followingPredefinedPath = false;
break;
}
} while (predefinedPath[nextValidDirectionIndex] == Direction.Zero);
} while (predefinedPath[nextValidDirectionIndex] == Vector2.zero);
}
// gameStateManager.statusDisplay.SetDebugText(1, predefinedPathIndex.ToString());
@@ -210,97 +207,74 @@ namespace Marro.PacManUdon
return nextPosition;
}
private void CheckNewTile(Vector2 position, Vector2 nextPosition)
private void UpdateAnimator()
{
var eatResult = collisionManager.PacManMoveToTile(position, nextPosition);
if (eatResult == EatResult.Pellet)
{
freezeSeconds = 0.0165f;
}
else if (eatResult == EatResult.PowerPellet)
{
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;
switch (state)
animator.SetBool(AnimatorKeyDead, dead);
if (dead)
{
case PacManState.Dead:
SetAnimatorState((int)PacManAnimatorState.Dead);
animator.speed = 1;
return;
case PacManState.Idle:
SetAnimatorState((int)PacManAnimatorState.Idle);
return;
case PacManState.Big:
SetAnimatorState((int)PacManAnimatorState.Big);
animator.speed = 1;
return;
animator.speed = 1;
return;
}
if (direction.Equals(Direction.Zero))
if (frozen || direction.Equals(Vector2.zero))
{
SetAnimatorState((int)PacManAnimatorState.Stopped);
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionNone);
animator.speed = 0;
}
else
{
SetAnimatorState((int)PacManAnimatorState.Moving);
animator.speed = 1;
if (targetDirection.Equals(Vector2.right))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionRight);
}
else if (targetDirection.Equals(Vector2.left))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionLeft);
}
else if (targetDirection.Equals(Vector2.up))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionUp);
}
else if (targetDirection.Equals(Vector2.down))
{
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionDown);
}
}
animator.speed = frozen ? 0 : 1;
SetAnimatorDirection((int)targetDirection);
}
private void SetAnimatorDirection(int value) =>
animator.SetFloat(animatorKeyDirection, value);
private void SetAnimatorState(int value) =>
animator.SetFloat(animatorKeyState, value);
public void Die()
public void SetDead(bool dead)
{
state = PacManState.Dead;
this.dead = dead;
UpdateAnimator();
}
public void SetFrozen(bool frozen)
{
this.frozen = frozen;
if (!frozen && state == PacManState.Idle)
{
state = PacManState.Normal;
}
UpdateAnimator();
}
public void HideUntilUnfrozen()
{
hideUntilUnfrozen = true;
SetVisibility(false);
}
public void SetLevel(int level)
{
// Debug.Log($"{gameObject} SetLevel {level}");
defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level);
powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level);
UpdateSpeed();
}
public void SetPowerPellet(bool powerPellet)
{
state = powerPellet ? PacManState.PowerPellet : PacManState.Normal;
UpdateSpeed();
}
private void UpdateSpeed()
{
if (state == PacManState.PowerPellet)
if (powerPellet)
{
speed = powerPelletSpeed;
}
@@ -325,7 +299,7 @@ namespace Marro.PacManUdon
this.kinematic = kinematic;
}
public void SetPredefinedPath(Direction[] predefinedPath)
public void SetPredefinedPath(Vector2[] predefinedPath)
{
this.predefinedPath = predefinedPath;
followingPredefinedPath = true;
@@ -334,33 +308,86 @@ namespace Marro.PacManUdon
public void BecomeBig()
{
state = PacManState.Big;
UpdateAnimator();
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionRightBig);
}
public void SetVisibility(bool visible)
void SetVisibility(bool visible)
{
renderer.enabled = visible;
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
public override Vector2 GetPosition()
{
data.AppendAsByte((int)state, ref index);
data.Append(freezeSeconds, ref index);
data.Append(frozen, ref index);
base.CollectSyncedData(data, ref index, eventType);
return (Vector2)transform.localPosition;
}
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
public override void SetPosition(Vector2 position)
{
state = (PacManState)data.ReadByte(ref index);
freezeSeconds = data.ReadFloat(ref index);
frozen = data.ReadBool(ref index);
GridMoverTools.SetPosition(position, transform);
}
UpdateSpeed();
public override Vector2 GetDirection()
{
return direction;
}
return base.WriteSyncedData(data, ref index, eventType);
public void SetDirection(Vector2 direction)
{
this.direction = direction;
RequestSerialization();
UpdateAnimator();
}
public void SetTargetDirection(Vector2 targetDirection)
{
this.targetDirection = targetDirection;
UpdateAnimator();
}
public override void OnPreSerialization()
{
syncedPosition = GetPosition();
}
public override void OnDeserialization()
{
SetPosition(syncedPosition);
UpdateAnimator();
}
void OnTriggerEnter(Collider other)
{
Pellet pellet = other.gameObject.GetComponent<Pellet>();
if (pellet)
{
if (Networking.IsOwner(gameObject))
{
pelletPool.Return(pellet.gameObject);
}
else
{
pellet.pelletRenderer.enabled = false;
pellet.gameObject.SetActive(false);
}
if (pellet.isPowerPellet)
{
if (Networking.IsOwner(gameObject)) gameController.GotPowerPellet();
freezeSeconds = 0.05f;
}
else
{
if (Networking.IsOwner(gameObject)) gameController.GotPellet();
freezeSeconds = 0.0166666666666667f;
}
if (Networking.IsOwner(gameObject)) RequestSerialization();
return;
}
else if (Networking.IsOwner(gameObject) && other.gameObject.GetComponent<BonusFruit>())
{
gameController.GotFruit();
}
}
}
}

View File

@@ -49,124 +49,16 @@ namespace Marro.PacManUdon
Intermission3
}
public enum PacManCollisionInfoType
{
Tunnel = 0b00100000,
HorizontalOnly = 0b00010000, // Bit that indicates tiles on which ghosts are only allowed to go horizontal unless they're scared
NoTurn = 0b01000000,
Wall = 0b10000000,
}
public enum PacManConsumableType
{
None = 255,
FruitLeft = 254,
FruitRight = 253,
}
public static class PacManConstants
{
// Jagged or 2D arrays can't be static so we work with 1D arrays
public static byte[] GetMazeCollisionInfo() => new byte[]
{
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,
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,
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, 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,
};
public static byte[] GetMazePelletMap() => new byte[]
{
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 021, 022, 023, 024, 025, 026, 027, 028, 029, 030, 031, 032, 033, 034, 035, 036, 037, 038, 039, 040, 041, 042, 043, 044, 045, 046, 255, 255, 255,
255, 255, 255, 020, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 072, 255, 255, 071, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 047, 255, 255, 255,
255, 255, 255, 019, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 073, 255, 255, 070, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 048, 255, 255, 255,
255, 255, 255, 018, 017, 016, 015, 014, 013, 255, 255, 077, 076, 075, 074, 255, 255, 069, 068, 067, 066, 255, 255, 054, 053, 052, 051, 050, 049, 255, 255, 255,
255, 255, 255, 255, 255, 080, 255, 255, 012, 255, 255, 078, 255, 255, 255, 255, 255, 255, 255, 255, 065, 255, 255, 055, 255, 255, 113, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 081, 255, 255, 011, 255, 255, 079, 255, 255, 255, 255, 255, 255, 255, 255, 064, 255, 255, 056, 255, 255, 114, 255, 255, 255, 255, 255,
255, 255, 255, 000, 083, 082, 255, 255, 010, 009, 008, 007, 006, 005, 004, 255, 255, 063, 062, 061, 060, 059, 058, 057, 255, 255, 115, 116, 001, 255, 255, 255,
255, 255, 255, 084, 255, 255, 255, 255, 093, 255, 255, 255, 255, 255, 101, 255, 255, 102, 255, 255, 255, 255, 255, 112, 255, 255, 255, 255, 117, 255, 255, 255,
255, 255, 255, 085, 255, 255, 255, 255, 092, 255, 255, 255, 255, 255, 100, 255, 255, 103, 255, 255, 255, 255, 255, 111, 255, 255, 255, 255, 118, 255, 255, 255,
255, 255, 255, 086, 087, 088, 089, 090, 091, 094, 095, 096, 097, 098, 099, 255, 255, 104, 105, 106, 107, 108, 109, 110, 123, 122, 121, 120, 119, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 243, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 124, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 242, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 125, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 241, 255, 255, 255, 255, 255, 255, 253, 254, 255, 255, 255, 255, 255, 255, 126, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 240, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 239, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 128, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 238, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 129, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 237, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 130, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 236, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 131, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 235, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 132, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 234, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 133, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 233, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 134, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 225, 226, 227, 228, 229, 232, 255, 255, 207, 208, 209, 210, 255, 255, 170, 169, 168, 167, 255, 255, 135, 136, 137, 138, 139, 140, 255, 255, 255,
255, 255, 255, 224, 255, 255, 255, 255, 231, 255, 255, 206, 255, 255, 255, 255, 255, 255, 255, 255, 166, 255, 255, 161, 255, 255, 255, 255, 141, 255, 255, 255,
255, 255, 255, 223, 255, 255, 255, 255, 230, 255, 255, 205, 255, 255, 255, 255, 255, 255, 255, 255, 165, 255, 255, 160, 255, 255, 255, 255, 142, 255, 255, 255,
255, 255, 255, 218, 219, 220, 221, 222, 199, 200, 201, 202, 203, 204, 185, 184, 183, 173, 172, 171, 164, 163, 162, 155, 156, 157, 158, 159, 143, 255, 255, 255,
255, 255, 255, 217, 255, 255, 255, 255, 198, 255, 255, 255, 255, 255, 186, 255, 255, 174, 255, 255, 255, 255, 255, 154, 255, 255, 255, 255, 144, 255, 255, 255,
255, 255, 255, 003, 255, 255, 255, 255, 197, 255, 255, 255, 255, 255, 187, 255, 255, 175, 255, 255, 255, 255, 255, 153, 255, 255, 255, 255, 002, 255, 255, 255,
255, 255, 255, 216, 255, 255, 255, 255, 196, 255, 255, 255, 255, 255, 188, 255, 255, 176, 255, 255, 255, 255, 255, 152, 255, 255, 255, 255, 145, 255, 255, 255,
255, 255, 255, 215, 214, 213, 212, 211, 195, 194, 193, 192, 191, 190, 189, 255, 255, 177, 178, 179, 180, 181, 182, 151, 150, 149, 148, 147, 146, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
};
public static int[] GetMazePelletIndices() => new int[]
{
227, 252, 892, 867, 238, 237, 236, 235, 234, 233, 232, 200, 168, 136, 135, 134,
133, 132, 131, 099, 067, 035, 036, 037, 038, 039, 040, 041, 042, 043, 044, 045,
046, 047, 048, 049, 050, 051, 052, 053, 054, 055, 056, 057, 058, 059, 060, 092,
124, 156, 155, 154, 153, 152, 151, 183, 215, 247, 246, 245, 244, 243, 242, 241,
212, 180, 148, 147, 146, 145, 113, 081, 078, 110, 142, 141, 140, 139, 171, 203,
165, 197, 229, 228, 259, 291, 323, 324, 325, 326, 327, 328, 296, 264, 329, 330,
331, 332, 333, 334, 302, 270, 273, 305, 337, 338, 339, 340, 341, 342, 343, 311,
279, 186, 218, 250, 251, 284, 316, 348, 347, 346, 345, 344, 375, 407, 439, 471,
503, 535, 567, 599, 631, 663, 695, 727, 728, 729, 730, 731, 732, 764, 796, 828,
860, 924, 956, 955, 954, 953, 952, 951, 919, 887, 855, 823, 824, 825, 826, 827,
791, 759, 822, 821, 820, 788, 756, 724, 723, 722, 721, 819, 818, 817, 849, 881,
913, 945, 946, 947, 948, 949, 950, 816, 815, 814, 846, 878, 910, 942, 941, 940,
939, 938, 937, 936, 904, 872, 840, 808, 809, 810, 811, 812, 813, 779, 747, 715,
716, 717, 718, 935, 934, 933, 932, 931, 899, 835, 803, 804, 805, 806, 807, 771,
739, 707, 708, 709, 710, 711, 776, 744, 712, 680, 648, 616, 584, 552, 520, 488,
456, 424, 392, 360,
};
public static GameObject[] ComponentsToGameObjects(Component[] components, bool skipFirstComponent = false)
{
if (skipFirstComponent)
{
GameObject[] gameObjects = new GameObject[components.Length - 1];
for (int i = 0; i < components.Length - 1; i++)
GameObject[] gameObjects = new GameObject[components.Length-1];
for (int i = 0; i < components.Length-1; i++)
{
gameObjects[i] = components[i + 1].gameObject;
gameObjects[i] = components[i+1].gameObject;
}
return gameObjects;
}
@@ -205,15 +97,15 @@ namespace Marro.PacManUdon
PacManFruitType.Bell,
PacManFruitType.Key
};
if (level - 1 < 0)
if (level-1 < 0)
{
return PacManFruitType.None;
}
if (level - 1 >= FruitTypePerLevel.Length)
if (level-1 >= FruitTypePerLevel.Length)
{
return FruitTypePerLevel[FruitTypePerLevel.Length - 1];
return FruitTypePerLevel[FruitTypePerLevel.Length-1];
}
return FruitTypePerLevel[level - 1];
return FruitTypePerLevel[level-1];
}
public static float GetGhostHomeSpeed()
@@ -223,96 +115,96 @@ namespace Marro.PacManUdon
public static float GetPacManDefaultSpeedForLevel(int level)
{
if (level <= 1) return 7.576f;
if (level <= 4) return 8.523f;
if (level <= 20) return 9.470f;
return 8.523f;
if(level <= 1) return 7.576f;
if(level <= 4) return 8.523f;
if(level <= 20) return 9.470f;
return 8.523f;
}
public static float GetPacManPowerPelletSpeedForLevel(int level)
{
if (level <= 1) return 8.523f;
if (level <= 4) return 8.996f;
return 9.470f;
if(level <= 1) return 8.523f;
if(level <= 4) return 8.996f;
return 9.470f;
}
public static float GetGhostDefaultSpeedForLevel(int level)
{
if (level <= 1) return 7.102f;
if (level <= 4) return 8.049f;
return 8.996f;
if(level <= 1) return 7.102f;
if(level <= 4) return 8.049f;
return 8.996f;
}
public static float GetGhostTunnelSpeedForLevel(int level)
{
if (level <= 1) return 3.788f;
if (level <= 4) return 4.261f;
return 4.735f;
if(level <= 1) return 3.788f;
if(level <= 4) return 4.261f;
return 4.735f;
}
public static float GetBlinkyElroy1SpeedForLevel(int level)
{
if (level <= 1) return 7.576f;
if (level <= 4) return 8.523f;
return 9.470f;
if(level <= 1) return 7.576f;
if(level <= 4) return 8.523f;
return 9.470f;
}
public static float GetBlinkyElroy2SpeedForLevel(int level)
{
if (level <= 1) return 8.049f;
if (level <= 4) return 8.996f;
return 9.943f;
if(level <= 1) return 8.049f;
if(level <= 4) return 8.996f;
return 9.943f;
}
public static float GetGhostScaredSpeedForLevel(int level)
{
if (level <= 1) return 4.735f;
if (level <= 4) return 5.208f;
return 5.682f;
if(level <= 1) return 4.735f;
if(level <= 4) return 5.208f;
return 5.682f;
}
public static int GetElroy1PelletsRemainingForLevel(int level)
{
if (level <= 1) return 20;
if (level <= 2) return 30;
if (level <= 5) return 40;
if (level <= 8) return 50;
if (level <= 11) return 60;
if (level <= 14) return 80;
if (level <= 18) return 100;
return 120;
if(level <= 1) return 20;
if(level <= 2) return 30;
if(level <= 5) return 40;
if(level <= 8) return 50;
if(level <= 11) return 60;
if(level <= 14) return 80;
if(level <= 18) return 100;
return 120;
}
public static int GetElroy2PelletsRemainingForLevel(int level)
{
if (level <= 1) return 10;
if (level <= 2) return 15;
if (level <= 5) return 20;
if (level <= 8) return 25;
if (level <= 11) return 30;
if (level <= 14) return 40;
if (level <= 18) return 50;
return 60;
if(level <= 1) return 10;
if(level <= 2) return 15;
if(level <= 5) return 20;
if(level <= 8) return 25;
if(level <= 11) return 30;
if(level <= 14) return 40;
if(level <= 18) return 50;
return 60;
}
public static float GetGhostHousePelletTimeoutLimitForLevel(int level)
{
if (level <= 4) return 4;
return 3;
if(level <= 4) return 4;
return 3;
}
public static int[] GetGhostHousePrivatePelletCounterLimitForLevel(int level)
{
if (level <= 1) return new int[] { 0, 0, 30, 60 };
if (level <= 2) return new int[] { 0, 0, 0, 50 };
return new int[] { 0, 0, 0, 0 };
if(level <= 1) return new int[] { 0, 0, 30, 60};
if(level <= 2) return new int[] { 0, 0, 0, 50};
return new int[] { 0, 0, 0, 0};
}
public static float[] GetScatterPatternForLevel(int level)
{
if (level <= 1) return new float[] { 7, 27, 34, 54, 59, 79, 84 };
if (level <= 4) return new float[] { 7, 27, 34, 54, 59, 1092, 1092.0166667f };
return new float[] { 5, 25, 30, 50, 55, 1092, 1092.0166667f };
if(level <= 1) return new float[] { 7, 27, 34, 54, 59, 79, 84 };
if(level <= 4) return new float[] { 7, 27, 34, 54, 59, 1092, 1092.0166667f};
return new float[] { 5, 25, 30, 50, 55, 1092, 1092.0166667f};
}
public static float GetScaredDurationForLevel(int level)
@@ -339,15 +231,15 @@ namespace Marro.PacManUdon
1,
0
};
if (level - 1 < 0)
if (level-1 < 0)
{
return scaredDurationPerLevel[0];
}
if (level - 1 >= scaredDurationPerLevel.Length)
if (level-1 >= scaredDurationPerLevel.Length)
{
return scaredDurationPerLevel[scaredDurationPerLevel.Length - 1];
return scaredDurationPerLevel[scaredDurationPerLevel.Length-1];
}
return scaredDurationPerLevel[level - 1];
return scaredDurationPerLevel[level-1];
}
public static float GetScaredNumberOfFlashesForLevel(int level)
@@ -374,19 +266,18 @@ namespace Marro.PacManUdon
3,
0
};
if (level - 1 < 0)
if (level-1 < 0)
{
return scaredNumberOfFlashesPerLevel[0];
}
if (level - 1 >= scaredNumberOfFlashesPerLevel.Length)
if (level-1 >= scaredNumberOfFlashesPerLevel.Length)
{
return scaredNumberOfFlashesPerLevel[scaredNumberOfFlashesPerLevel.Length - 1];
return scaredNumberOfFlashesPerLevel[scaredNumberOfFlashesPerLevel.Length-1];
}
return scaredNumberOfFlashesPerLevel[level - 1];
return scaredNumberOfFlashesPerLevel[level-1];
}
public static int FruitTypeToValue(PacManFruitType fruitType)
{ // I can't get casting from enum to int to work so this is a workaround
public static int FruitTypeToValue(PacManFruitType fruitType) { // I can't get casting from enum to int to work so this is a workaround
switch (fruitType)
{
default:

View File

@@ -85,7 +85,13 @@ MonoBehaviour:
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 5|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -106,13 +112,13 @@ MonoBehaviour:
Data: pelletRenderer
- 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: pelletRenderer
- Name: <UserType>k__BackingField
Entry: 7
Data: 6|System.RuntimeType, mscorlib
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Renderer, UnityEngine.CoreModule
@@ -121,7 +127,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 6
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -136,7 +142,7 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0

View File

@@ -3,10 +3,9 @@
using UdonSharp;
using UnityEngine;
[RequireComponent(typeof(Renderer))]
public class Pellet : UdonSharpBehaviour
{
public bool isPowerPellet = false;
[SerializeField] public bool isPowerPellet = false;
public Renderer pelletRenderer;
void Start()

View File

@@ -10,17 +10,17 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: TestBall
m_Name: PelletManager
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 8968388b0e4fe434fb8da62328c108a0, type: 2}
serializedUdonProgramAsset: {fileID: 11400000, guid: 9047ff9c4ab51104b8b0160387ad180b, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 0980d82a15346eb45b49fd33db0ffee9, type: 3}
sourceCsScript: {fileID: 11500000, guid: 71c8438dc95de4c44896841f1fece6b9, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -3035274785675086507
scriptID: 2205517818672966804
serializationData:
SerializedFormat: 2
SerializedBytes:
@@ -43,25 +43,25 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 9
Data: 8
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: networkManager
Data: pellets
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager
Data: pellets
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, Assembly-CSharp
Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
- Name:
Entry: 8
Data:
@@ -70,7 +70,7 @@ MonoBehaviour:
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
Data: UnityEngine.Component[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -89,6 +89,66 @@ MonoBehaviour:
- 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: pelletPool
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pelletPool
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Components.VRCObjectPool, VRCSDK3
- 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: false
- Name: _fieldAttributes
Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -109,79 +169,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: start
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: start
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Transform, UnityEngine.CoreModule
- 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
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 9|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: end
Data: pelletRenderers
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: end
Data: pelletRenderers
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
Entry: 7
Data: 11|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Renderer[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 11
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -193,19 +199,13 @@ MonoBehaviour:
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 12|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
Data: 0
- Name:
Entry: 13
Data:
@@ -223,31 +223,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: mode
Data: powerPellets
- Name: $v
Entry: 7
Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: mode
Data: powerPellets
- Name: <UserType>k__BackingField
Entry: 7
Data: 14|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TestBallMode, Assembly-CSharp
Data: UnityEngine.Animator[], UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 15|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
Entry: 9
Data: 14
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -259,19 +253,13 @@ MonoBehaviour:
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 17|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
Data: 0
- Name:
Entry: 13
Data:
@@ -289,16 +277,70 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: sumOfDt
Data: powerPelletBlinkEnabled
- Name: $v
Entry: 7
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: sumOfDt
Data: powerPelletBlinkEnabled
- Name: <UserType>k__BackingField
Entry: 7
Data: 19|System.RuntimeType, mscorlib
Data: 17|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- 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
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: powerPelletBlinkToggleInterval
- Name: $v
Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: powerPelletBlinkToggleInterval
- Name: <UserType>k__BackingField
Entry: 7
Data: 20|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
@@ -307,7 +349,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 19
Data: 20
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -322,7 +364,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -343,19 +385,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: amountUp
Data: powerPelletBlinkProgress
- Name: $v
Entry: 7
Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: amountUp
Data: powerPelletBlinkProgress
- Name: <UserType>k__BackingField
Entry: 9
Data: 19
Data: 20
- Name: <SystemType>k__BackingField
Entry: 9
Data: 19
Data: 20
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -370,7 +412,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -391,19 +433,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: loopOffset
Data: powerPelletBlinkCurrentlyVisible
- Name: $v
Entry: 7
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: loopOffset
Data: powerPelletBlinkCurrentlyVisible
- Name: <UserType>k__BackingField
Entry: 9
Data: 19
Data: 17
- Name: <SystemType>k__BackingField
Entry: 9
Data: 19
Data: 17
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -418,109 +460,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: jumps
- Name: $v
Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: jumps
- Name: <UserType>k__BackingField
Entry: 7
Data: 26|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single[], mscorlib
- Name:
Entry: 8
Data:
- 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: 27|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: jumpsIndex
- Name: $v
Entry: 7
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: jumpsIndex
- Name: <UserType>k__BackingField
Entry: 9
Data: 15
- Name: <SystemType>k__BackingField
Entry: 9
Data: 15
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0

View File

@@ -0,0 +1,108 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Components;
using VRC.SDKBase;
using VRC.Udon;
public class PelletManager : UdonSharpBehaviour
{
[SerializeField] Pellet[] pellets;
VRCObjectPool pelletPool;
Renderer[] pelletRenderers;
Animator[] powerPellets;
bool powerPelletBlinkEnabled;
float powerPelletBlinkToggleInterval;
float powerPelletBlinkProgress;
bool powerPelletBlinkCurrentlyVisible;
public void Initialize(VRCObjectPool pelletPool)
{
gameObject.SetActive(true);
this.pelletPool = pelletPool;
pelletRenderers = new Renderer[pelletPool.Pool.Length];
for (int i = 0; i < pelletRenderers.Length; i++)
{
pelletRenderers[i] = pelletPool.Pool[i].GetComponent<Renderer>();
}
powerPellets = GetComponentsInChildren<Animator>(true);
// Debug.Log($"{gameObject} Initialized, powerPellets: {powerPellets}");
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
SetPowerPelletsBlink(false);
}
public void Initialize()
{
pelletRenderers = new Renderer[pellets.Length];
for (int i = 0; i < pelletRenderers.Length; i++)
{
pelletRenderers[i] = pellets[i].GetComponent<Renderer>();
}
powerPellets = GetComponentsInChildren<Animator>(true);
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
SetPowerPelletsBlink(false);
}
void Update()
{
if (!powerPelletBlinkEnabled)
{
return;
}
powerPelletBlinkProgress += Time.deltaTime;
if (powerPelletBlinkProgress >= powerPelletBlinkToggleInterval)
{
// Debug.Log($"{gameObject} PowerPelletBlink toggle");
powerPelletBlinkProgress -= powerPelletBlinkToggleInterval;
powerPelletBlinkCurrentlyVisible = !powerPelletBlinkCurrentlyVisible;
SetPowerPelletsVisible(powerPelletBlinkCurrentlyVisible);
}
}
void SetPowerPelletsVisible(bool visible)
{
// Debug.Log($"{gameObject} SetPowerPelletVisible {visible}, powerPellets.Length: {powerPellets.Length}");
foreach (Animator powerPellet in powerPellets)
{
powerPellet.SetBool("Visible", visible);
}
}
public void SetPowerPelletsBlink(bool enabled)
{
// Debug.Log($"{gameObject} SetPowerPelletBlink {enabled}");
powerPelletBlinkEnabled = enabled;
powerPelletBlinkCurrentlyVisible = true;
powerPelletBlinkProgress = 0;
SetPowerPelletsVisible(true);
}
public void FreezePowerPelletsBlink(bool frozen)
{
powerPelletBlinkEnabled = !frozen;
}
public void RestoreAllPellets()
{
foreach (GameObject pellet in pelletPool.Pool)
{
if (pelletPool.TryToSpawn() == false)
{
break;
}
}
foreach (Renderer pelletRenderer in pelletRenderers)
{
pelletRenderer.enabled = true;
}
}
}
}

View File

@@ -43,37 +43,31 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 10
Data: 8
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: networkManager
Data: active
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager
Data: active
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, Assembly-CSharp
Data: System.Boolean, mscorlib
- 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:
Entry: 9
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -88,7 +82,7 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -109,25 +103,31 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: active
Data: gameController
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: active
Data: gameController
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
Data: 6|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Entry: 7
Data: 7|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
@@ -139,7 +139,7 @@ MonoBehaviour:
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
@@ -163,25 +163,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: gameManager
Data: inputHorizontal
- Name: $v
Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: gameManager
Data: inputHorizontal
- Name: <UserType>k__BackingField
Entry: 7
Data: 10|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Data: 10
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -217,25 +217,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: player
Data: inputVertical
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: player
Data: inputVertical
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
- Name:
Entry: 8
Data:
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 13
Data: 10
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -250,7 +244,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -271,31 +265,73 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: inputMethod
Data: horizontalValue
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: inputMethod
Data: horizontalValue
- Name: <UserType>k__BackingField
Entry: 7
Data: 16|System.RuntimeType, mscorlib
Data: 15|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.InputMethod, Assembly-CSharp
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 15
- Name: <SyncMode>k__BackingField
Entry: 7
Data: 17|System.RuntimeType, mscorlib
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: verticalValue
- Name: $v
Entry: 7
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: verticalValue
- Name: <UserType>k__BackingField
Entry: 9
Data: 15
- Name: <SystemType>k__BackingField
Entry: 9
Data: 15
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -331,229 +367,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: resultInput
Data: horizontalPriority
- Name: $v
Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: resultInput
- Name: <UserType>k__BackingField
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: 17
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: analogInput
- Name: $v
Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: analogInput
- Name: <UserType>k__BackingField
Entry: 7
Data: 23|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector2, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 23
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: 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
Data: 3
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -568,7 +394,61 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 20|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: player
- Name: $v
Entry: 7
Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: player
- Name: <UserType>k__BackingField
Entry: 7
Data: 22|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 22
- 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: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0

View File

@@ -1,80 +1,30 @@
namespace Marro.PacManUdon
{
using System;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using VRC.Udon.Common;
enum InputMethod
{
KeyboardMouse,
Other,
}
public class PlayerInput : SyncedObject
public class PlayerInput : UdonSharpBehaviour
{
public bool active;
private GameManager gameController;
Vector2 inputHorizontal;
Vector2 inputVertical;
float horizontalValue;
float verticalValue;
bool horizontalPriority;
VRCPlayerApi player;
private GameManager gameManager;
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)
public void Initialize(GameManager gameController)
{
this.gameManager = gameManager;
player = Networking.LocalPlayer;
inputMethod = InputMethod.KeyboardMouse;
resultInput = Direction.Zero;
analogInput = Vector2.zero;
dirty = false;
this.gameController = gameController;
inputHorizontal = Vector2.zero;
inputVertical = Vector2.zero;
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();
}
player = Networking.LocalPlayer;
}
public void Activate()
@@ -85,7 +35,7 @@
player.SetRunSpeed(0);
player.SetStrafeSpeed(0);
gameManager.JoystickGrabbed();
gameController.JoystickGrabbed();
}
public void Deactivate()
@@ -96,7 +46,7 @@
player.SetStrafeSpeed(2);
active = false;
gameManager.JoystickReleased();
gameController.JoystickReleased();
}
public override void InputJump(bool pressed, UdonInputEventArgs args)
@@ -118,10 +68,33 @@
{
return;
}
horizontalValue = Math.Abs(value);
if (value < -0.5)
{
inputHorizontal = Vector2.left;
if (horizontalValue >= verticalValue)
{
// horizontalPriority = true;
SetPriority(true);
}
}
else if (value > 0.5)
{
inputHorizontal = Vector2.right;
if (horizontalValue >= verticalValue)
{
// horizontalPriority = true;
SetPriority(true);
}
}
else
{
inputHorizontal = Vector2.zero;
// horizontalPriority = false;
SetPriority(false);
}
analogInput.x = value;
lastUsedHand = args.handType;
dirty = true;
// Debug.Log("Horizontal Input Event: " + value + " | Direction: " + direction + " | lastDirection: " + lastDirection + " | Left: " + left + " | Right: " + right);
}
public override void InputMoveVertical(float value, UdonInputEventArgs args)
@@ -130,145 +103,100 @@
{
return;
}
analogInput.y = value;
lastUsedHand = args.handType;
dirty = true;
verticalValue = Math.Abs(value);
if (value < -0.5)
{
inputVertical = Vector2.down;
if (verticalValue >= horizontalValue)
{
// horizontalPriority = false;
SetPriority(false);
}
}
else if (value > 0.5)
{
inputVertical = Vector2.up;
if (verticalValue >= horizontalValue)
{
// horizontalPriority = false;
SetPriority(false);
}
}
else
{
inputVertical = Vector2.zero;
// horizontalPriority = true;
SetPriority(true);
}
// Debug.Log("Vertical Input Event: " + value + " | Direction: " + direction + " | lastDirection : " + lastDirection);
}
public override void OnInputMethodChanged(VRCInputMethod inputMethod)
private void SetPriority(bool horizontalPriority)
{
switch (inputMethod)
if (this.horizontalPriority != horizontalPriority)
{
case VRCInputMethod.Keyboard:
case VRCInputMethod.Mouse:
this.inputMethod = InputMethod.KeyboardMouse;
return;
default:
this.inputMethod = InputMethod.Other;
return;
player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75);
this.horizontalPriority = horizontalPriority;
}
}
private void UpdateResultInput()
// public Vector2[] GetDirections() {
// return new Vector2[]{inputHorizontal, inputVertical};
// }
public Vector2 GetDirection()
{
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;
return inputHorizontal;
}
if (normalized.y > 0)
else
{
return Direction.Up;
return inputVertical;
}
return Direction.Down;
}
public Direction GetDirection()
public void OverrideDirection(Vector2 direction) // For recording the demo only, should not be used when shipped as it is very much a hack
{
if (dirty) // Update now to reduce input delay
{
UpdateResultInput();
}
return resultInput;
inputHorizontal = new Vector2(direction.x, direction.y);
horizontalPriority = true;
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.InputChange)
{
return;
}
// public Vector2 GetRotatedDirection() {
// return RotateDirection(GetDirection(), rotation);
// }
ByteUtils.AppendAsByte(data, (int)resultInput, ref index);
}
// public Vector2 RotateDirection(Vector2 direction, int rotation) {
// rotation = rotation%4;
// // Debug.Log(direction + " " + rotation);
// switch(rotation) {
// default:
// return direction;
// case 1:
// return new Vector2(direction.y, -direction.x);
// case 2:
// return new Vector2(-direction.x, -direction.y);
// case 3:
// return new Vector2(-direction.y, direction.x);
// }
// }
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;
}
// public override void InputLookHorizontal(float value, UdonInputEventArgs args)
// {
// float rotation = player.GetRotation().eulerAngles.y;
// if(rotation > 45 && rotation <= 135) {
// // Debug.Log("Right");
// this.rotation = 1;
// } else if(rotation > 135 && rotation <= 225) {
// // Debug.Log("Backward");
// this.rotation = 2;
// } else if(rotation > 225 && rotation <= 315) {
// // Debug.Log("Left");
// this.rotation = 3;
// } else if(rotation > 315 || rotation <= 45) {
// // Debug.Log("Forward");
// this.rotation = 0;
// }
// }
}
}

View File

@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: 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,5 +1,5 @@
fileFormatVersion: 2
guid: a327a0e472dbf694a8e2b23bf0ce90d0
guid: 896816ace5640c644bd057ab48c3b9a1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -0,0 +1,12 @@
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,5 +1,5 @@
fileFormatVersion: 2
guid: ac984c07ae3e9674a850c3916be56ca3
guid: 55d0efe8af4dba540a508287baca6656
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -43,82 +43,22 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 4
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: networkManager
Data: animator
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager
Data: animator
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, 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: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: animator
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: animator
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
@@ -127,7 +67,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -142,7 +82,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -166,13 +106,13 @@ MonoBehaviour:
Data: countdownSeconds
- Name: $v
Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 5|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: countdownSeconds
- Name: <UserType>k__BackingField
Entry: 7
Data: 10|System.RuntimeType, mscorlib
Data: 6|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
@@ -181,7 +121,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 10
Data: 6
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -196,7 +136,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 7|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -220,13 +160,13 @@ MonoBehaviour:
Data: countingDown
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 8|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: countingDown
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
Data: 9|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
@@ -235,7 +175,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 13
Data: 9
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -250,7 +190,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0

View File

@@ -1,9 +1,11 @@
using UnityEngine;
namespace Marro.PacManUdon
namespace Marro.PacManUdon
{
[RequireComponent(typeof(Animator))]
public class ScoreBonusDisplay : SyncedObject
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class ScoreBonusDisplay : UdonSharpBehaviour
{
private Animator animator;
private float countdownSeconds;
@@ -16,11 +18,11 @@ namespace Marro.PacManUdon
gameObject.SetActive(false);
}
public override void SyncedUpdate()
void Update()
{
if (countingDown)
{
countdownSeconds -= networkManager.SyncedDeltaTime;
countdownSeconds -= Time.deltaTime;
if (countdownSeconds <= 0)
{
Hide();
@@ -46,15 +48,5 @@ namespace Marro.PacManUdon
countingDown = false;
gameObject.SetActive(false);
}
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

@@ -14,314 +14,316 @@ namespace Marro.PacManUdon
SetGameState(PacManGameState.AttractModeDemo);
break;
case 1:
InitializeLevel();
SetMazeVisible(true);
SetLevel(1);
break;
case 2:
// Setup ghosts
ghostManager.Ghosts[0].SetPredefinedPath(new Direction[]{ // Blinky
Direction.Up,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Zero,
Direction.Zero,
Direction.Down,
Direction.Right,
Direction.Up,
Direction.Zero,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Down,
Direction.Zero,
Direction.Left,
Direction.Up,
Direction.Zero,
Direction.Left,
Direction.Up,
Direction.Right,
ghostManager.Ghosts[0].SetPredefinedPath(new Vector2[]{ // Blinky
Vector2.down,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.zero,
Vector2.zero,
Vector2.up,
Vector2.right,
Vector2.down,
Vector2.zero,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.up,
Vector2.zero,
Vector2.left,
Vector2.down,
Vector2.zero,
Vector2.left,
Vector2.down,
Vector2.right,
// Goes through tunnel
Direction.Zero,
Direction.Down,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Zero,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Down,
Direction.Left,
Vector2.zero,
Vector2.up,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.zero,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.up,
Vector2.left,
// Gets eaten
Direction.Zero,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Vector2.zero,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
});
ghostManager.Ghosts[1].SetPredefinedPath(new Direction[]{ // Pinky
Direction.Up,
Direction.Left,
Direction.Down,
Direction.Zero,
Direction.Zero,
Direction.Left,
Direction.Up,
Direction.Right,
ghostManager.Ghosts[1].SetPredefinedPath(new Vector2[]{ // Pinky
Vector2.down,
Vector2.left,
Vector2.up,
Vector2.zero,
Vector2.zero,
Vector2.left,
Vector2.down,
Vector2.right,
// Pellet starts
Direction.Down,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Down,
Direction.Right,
Vector2.up,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.up,
Vector2.right,
// Pellet ends
Direction.Zero,
Direction.Up,
Vector2.zero,
Vector2.down,
// Pellet starts
Direction.Left,
Direction.Up,
Direction.Zero,
Direction.Left,
Vector2.left,
Vector2.down,
Vector2.zero,
Vector2.left,
// Caught
Direction.Down,
Direction.Right,
Direction.Zero,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Right,
Vector2.up,
Vector2.right,
Vector2.zero,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.right,
// Home
Direction.Up,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Up,
Direction.Zero,
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Zero,
Direction.Up,
Direction.Left,
Vector2.down,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.down,
Vector2.zero,
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.zero,
Vector2.down,
Vector2.left,
// Power pellet active
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Down,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Down
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.up,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.up
});
ghostManager.Ghosts[2].SetPredefinedPath(new Direction[]{ // Inky
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Zero,
Direction.Zero,
Direction.Up,
Direction.Right,
ghostManager.Ghosts[2].SetPredefinedPath(new Vector2[]{ // Inky
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.zero,
Vector2.zero,
Vector2.down,
Vector2.right,
// Pellet starts
Direction.Down,
Direction.Right,
Direction.Down,
Vector2.up,
Vector2.right,
Vector2.up,
// Caught
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Down,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Zero,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Zero,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Down,
Direction.Left
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.up,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.zero,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.zero,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.up,
Vector2.left
});
ghostManager.Ghosts[3].SetPredefinedPath(new Direction[]{ // Clyde
Direction.Up,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Up,
Direction.Zero,
Direction.Left,
Direction.Zero,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Down,
Direction.Right,
Direction.Zero,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Down,
Direction.Right,
Direction.Zero,
Direction.Down,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Down,
Direction.Right
ghostManager.Ghosts[3].SetPredefinedPath(new Vector2[]{ // Clyde
Vector2.down,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.down,
Vector2.zero,
Vector2.left,
Vector2.zero,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.up,
Vector2.right,
Vector2.zero,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.up,
Vector2.right,
Vector2.zero,
Vector2.up,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.up,
Vector2.right
});
pacMan.SetPredefinedPath(new Direction[]{
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Right,
Direction.Zero,
Direction.Down,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Zero,
Direction.Down,
Direction.Zero,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Down,
Direction.Zero,
Direction.Zero,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Zero,
Direction.Down,
Direction.Left,
Direction.Up,
Direction.Zero,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Zero,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Up,
Direction.Zero,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Zero,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Down,
Direction.Right,
Direction.Zero,
Direction.Up,
Direction.Right,
Direction.Down,
Direction.Right,
Direction.Zero,
Direction.Up,
Direction.Left,
Direction.Up,
Direction.Right,
Direction.Up,
Direction.Left,
Direction.Zero,
Direction.Zero,
Direction.Down,
Direction.Right,
Direction.Down,
Direction.Left,
Direction.Down,
Direction.Right,
pacMan.SetPredefinedPath(new Vector2[]{
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.right,
Vector2.zero,
Vector2.up,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.zero,
Vector2.up,
Vector2.zero,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.up,
Vector2.zero,
Vector2.zero,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.zero,
Vector2.up,
Vector2.left,
Vector2.down,
Vector2.zero,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.zero,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.down,
Vector2.zero,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.zero,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.up,
Vector2.right,
Vector2.zero,
Vector2.down,
Vector2.right,
Vector2.up,
Vector2.right,
Vector2.zero,
Vector2.down,
Vector2.left,
Vector2.down,
Vector2.right,
Vector2.down,
Vector2.left,
Vector2.zero,
Vector2.zero,
Vector2.up,
Vector2.right,
Vector2.up,
Vector2.left,
Vector2.up,
Vector2.right,
});
break;
case 3:
SetPelletsActive(true);
pelletManager.RestoreAllPellets();
statusDisplay.SetGameOverTextVisible(true);
break;
case 4:

View File

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

View File

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

View File

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

View File

@@ -26,14 +26,14 @@ namespace Marro.PacManUdon
pacMan.SetKinematic(true);
pacMan.SetActive(true);
pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition);
pacMan.SetDirectionAndTargetDirection(Direction.Left);
pacMan.SetDirection(Vector2.left);
ghostManager.SetLevel(5);
ghostManager.SetKinematic(true);
ghostManager.gameObject.SetActive(true);
blinky.SetElroy(2);
blinky.SetPosition(intermissionScreenElements[1].transform.localPosition);
blinky.SetDirectionAndTargetDirection(Direction.Left);
blinky.SetDirection(Vector2.left);
blinky.SetState(PacManGhostState.Normal);
SetFrozen(false);
@@ -46,14 +46,14 @@ namespace Marro.PacManUdon
// Reached end, make ghost scared and turn around
blinky.BecomeScared();
blinky.SetPosition(intermissionScreenElements[3].transform.localPosition);
pacMan.SetDirection(Direction.Zero);
pacMan.SetDirection(Vector2.zero);
pacMan.SetPosition(intermissionScreenElements[2].transform.localPosition);
pacMan.SetPowerPellet(true);
break;
case 4:
// Pacman starts chasing ghosts
pacMan.SetDirectionAndTargetDirection(Direction.Right);
pacMan.SetDirection(Vector2.right);
pacMan.BecomeBig();
break;
case 5:

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,7 @@ namespace Marro.PacManUdon
break;
case 1:
// Make maze visible
RestartLevel(afterLifeLost: true);
RestartLevel();
SetMazeVisible(true);
break;
case 2:
@@ -42,6 +42,7 @@ namespace Marro.PacManUdon
SetFrozen(false);
soundManager.SuppressSound(false);
soundManager.StartGhostSound();
soundManager.UpdatePelletCount(pelletCountRemaining);
}
}
}

View File

@@ -1,3 +1,5 @@
using UnityEngine;
namespace Marro.PacManUdon
{
public partial class GameManager
@@ -11,6 +13,7 @@ namespace Marro.PacManUdon
gameState = PacManGameState.InGame;
InitializeNewGame();
InitializeLevel();
PrepareForCutscene();
soundManager.SuppressSound(false);

View File

@@ -10,15 +10,14 @@ 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
IncrementLevel();
statusDisplay.SetExtraLivesDisplayVisible(true);
statusDisplay.SetLevelDisplayVisible(true);
statusDisplay.SetReadyTextVisible(true);
SetPelletsActive(true);
break;

View File

@@ -1,25 +1,32 @@
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.SDK3.Data;
namespace Marro.PacManUdon
{
public partial class GameManager
{
// A note about the quality of the code here:
// 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.
// 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.
bool currentlyInTimeSequence;
bool waitingForTimeSequenceFinalize;
bool waitingForTimeSequenceFinish;
bool jumpingToTimeSequence;
PacManTimeSequence currentTimeSequence;
float timeSequenceSecondsPassed;
[UdonSynced] float timeSequenceSecondsPassed;
int timeSequenceProgress;
float[] timeSequenceKeyframeTimes;
private void StartTimeSequence(PacManTimeSequence timeSequence)
{
//Debug.Log($"StartTimeSequence: {timeSequence}");
Debug.Log($"StartTimeSequence: {timeSequence}");
TimeSequenceTryEndCurrent();
if (currentlyInTimeSequence)
{
TimeSequenceEndCurrent();
}
TimeSequencePrepareForStart(timeSequence);
@@ -31,23 +38,10 @@ namespace Marro.PacManUdon
TimeSequenceProgressToTime(timeSequenceSecondsPassed);
}
private void TimeSequenceTryEndCurrent()
private void TimeSequenceEndCurrent()
{
if (!currentlyInTimeSequence)
{
return;
}
//Debug.Log($"{gameObject} TimeSequenceEndCurrent");
jumpingToTimeSequence = true;
TimeSequenceProgressToTime(100000f);
if (waitingForTimeSequenceFinalize)
{
TimeSequenceExecuteFinalize(currentTimeSequence);
}
jumpingToTimeSequence = false;
}
@@ -63,7 +57,7 @@ namespace Marro.PacManUdon
private void TimeSequenceSkipToNextStep()
{
//Debug.Log($"{gameObject} TimeSequenceSkipToNextStep");
// Debug.Log($"{gameObject} TimeSequenceSkipToNextStep");
if (timeSequenceProgress < timeSequenceKeyframeTimes.Length)
{
TimeSequenceProgressToTime(timeSequenceKeyframeTimes[timeSequenceProgress]);
@@ -86,38 +80,26 @@ namespace Marro.PacManUdon
if (timeSequenceProgress >= timeSequenceKeyframeTimes.Length)
{
currentlyInTimeSequence = false;
TimeSequenceFinish(currentTimeSequence);
TimeSequencePrepareForFinish(currentTimeSequence);
break;
}
}
}
private void TimeSequenceFinish(PacManTimeSequence timeSequence)
private void TimeSequencePrepareForFinish(PacManTimeSequence timeSequence)
{
TimeSequenceExecuteFinalize(timeSequence);
if (!jumpingToTimeSequence)
if (Networking.IsOwner(gameObject))
{
TimeSequenceExecuteFinished(timeSequence);
TimeSequenceExecuteFinalize(timeSequence);
if (!jumpingToTimeSequence)
{
TimeSequenceExecuteFinished(timeSequence);
}
}
}
private void TimeSequenceSyncWithRemote(PacManTimeSequence remoteCurrentTimeSequence, float timeSequenceSecondsPassedRemote)
{
// If our current time sequence state is incompatible with the remote time sequence, kill it
if (currentlyInTimeSequence && remoteCurrentTimeSequence != currentTimeSequence
|| timeSequenceSecondsPassedRemote < timeSequenceSecondsPassed)
else
{
currentlyInTimeSequence = false;
waitingForTimeSequenceFinish = true;
}
// If we're not/no longer in a time sequence, start the remote's time sequence
if (!currentlyInTimeSequence)
{
StartTimeSequence(remoteCurrentTimeSequence);
}
// Jump our progress to match the one on the remote
TimeSequenceProgressToTime(timeSequenceSecondsPassedRemote);
}
#region Events
@@ -230,7 +212,7 @@ namespace Marro.PacManUdon
private void TimeSequenceExecuteStep(PacManTimeSequence timeSequence, int sequenceProgress)
{
//Debug.Log($"{gameObject} Triggered time sequence step for sequence {currentTimeSequence} with progress {sequenceProgress}");
// Debug.Log($"{gameObject} Triggered time sequence step for sequence {currentTimeSequence} with progress {sequenceProgress}");
switch (timeSequence)
{
default:
@@ -284,7 +266,7 @@ namespace Marro.PacManUdon
private void TimeSequenceExecuteFinalize(PacManTimeSequence timeSequence)
{
//Debug.Log($"{gameObject} Triggered time sequence finalize for sequence {currentTimeSequence}");
// Debug.Log($"{gameObject} Triggered time sequence step for sequence {currentTimeSequence} with progress {sequenceProgress}");
switch (timeSequence)
{
default:
@@ -328,7 +310,7 @@ namespace Marro.PacManUdon
private void TimeSequenceExecuteFinished(PacManTimeSequence timeSequence)
{
//Debug.Log($"{gameObject} Triggered time sequence finished for sequence {currentTimeSequence}");
// Debug.Log($"{gameObject} Triggered time sequence step for sequence {currentTimeSequence} with progress {sequenceProgress}");
switch (timeSequence)
{
default:
@@ -432,5 +414,16 @@ namespace Marro.PacManUdon
}
#endregion
public int TimeSequenceProgress
{
get => timeSequenceProgress;
}
public float TimeSequenceSecondsPassed
{
get => timeSequenceSecondsPassed;
set => TimeSequenceProgressToTime(value);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,10 @@
using JetBrains.Annotations;
using Marro.PacManUdon;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class SoundManager : SyncedObject
public class SoundManager : UdonSharpBehaviour
{
[SerializeField] private AudioSource audioSourcePacMan;
[SerializeField] private AudioSource audioSourceGhosts;
@@ -28,13 +29,13 @@ public class SoundManager : SyncedObject
[SerializeField] private AudioClip siren3;
[SerializeField] private AudioClip siren4;
private bool alternatePelletSound;
private bool ghostRetreating;
private bool ghostBlue;
private int ghostSoundLevel;
private bool currentlyPlayingSiren;
private AudioClip _nextDotSound;
private bool _ghostRetreating;
private bool _ghostBlue;
private int _ghostSoundLevel;
private bool _currentlyPlayingSiren;
private bool suppress;
private bool _suppress;
public void Initialize()
{
@@ -45,19 +46,19 @@ public class SoundManager : SyncedObject
{
StopAllSound();
alternatePelletSound = false;
_nextDotSound = pacDot2;
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)
{
this.suppress = suppress;
_suppress = suppress;
if (suppress)
{
@@ -77,8 +78,8 @@ public class SoundManager : SyncedObject
public void PlayPelletSound()
{
PlaySound(audioSourcePacMan, alternatePelletSound ? pacDot2 : pacDot1);
alternatePelletSound = !alternatePelletSound;
PlaySound(audioSourcePacMan, _nextDotSound);
_nextDotSound = _nextDotSound == pacDot1 ? pacDot2 : pacDot1;
}
public void PlayDeathSound()
@@ -113,13 +114,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();
}
@@ -152,19 +153,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;
}
@@ -182,7 +183,7 @@ public class SoundManager : SyncedObject
private void SwitchSound(AudioSource audioSource, AudioClip audioClip, bool loop)
{
if (suppress)
if (_suppress)
{
return;
}
@@ -208,22 +209,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);
}
@@ -232,7 +233,7 @@ public class SoundManager : SyncedObject
PlaySound(audioSourceGhosts, currentGhostLevelSound, true);
}
currentlyPlayingSiren = true;
_currentlyPlayingSiren = true;
}
private AudioClip GetSoundForGhostLevel(int ghostLevel)
@@ -251,26 +252,4 @@ public class SoundManager : SyncedObject
return siren0;
};
}
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

@@ -49,31 +49,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: networkManager
Data: scoreDisplayGroup
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager
Data: scoreDisplayGroup
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, Assembly-CSharp
Data: UnityEngine.Transform, UnityEngine.CoreModule
- 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:
Entry: 9
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -88,10 +82,16 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 5|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -109,19 +109,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: scoreDisplayGroup
Data: label1UPText
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: scoreDisplayGroup
Data: label1UPText
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Transform, UnityEngine.CoreModule
Data: TMPro.TMP_Text, Unity.TextMeshPro
- Name:
Entry: 8
Data:
@@ -169,25 +169,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: label1UPText
Data: score1UPText
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: label1UPText
Data: score1UPText
- Name: <UserType>k__BackingField
Entry: 7
Data: 11|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: TMPro.TMP_Text, Unity.TextMeshPro
- Name:
Entry: 8
Data:
Entry: 9
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -202,67 +196,13 @@ MonoBehaviour:
Data: true
- 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: 1
- Name:
Entry: 7
Data: 13|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: score1UPText
- Name: $v
Entry: 7
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: score1UPText
- 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: true
- Name: _fieldAttributes
Entry: 7
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 16|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 12|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -286,16 +226,16 @@ MonoBehaviour:
Data: labelHighScoreText
- Name: $v
Entry: 7
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: labelHighScoreText
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -310,13 +250,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 19|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 15|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -340,16 +280,16 @@ MonoBehaviour:
Data: scoreHighScoreText
- Name: $v
Entry: 7
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: scoreHighScoreText
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -364,13 +304,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -394,16 +334,16 @@ MonoBehaviour:
Data: debugText
- Name: $v
Entry: 7
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: debugText
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -418,13 +358,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 21|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -448,16 +388,16 @@ MonoBehaviour:
Data: debugText2
- Name: $v
Entry: 7
Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: debugText2
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -472,13 +412,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 24|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -502,16 +442,16 @@ MonoBehaviour:
Data: gameOverText
- Name: $v
Entry: 7
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: gameOverText
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -526,13 +466,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 31|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 27|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -556,16 +496,16 @@ MonoBehaviour:
Data: player1Text
- Name: $v
Entry: 7
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: player1Text
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -580,13 +520,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 34|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 30|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -610,16 +550,16 @@ MonoBehaviour:
Data: readyText
- Name: $v
Entry: 7
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: readyText
- Name: <UserType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 11
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -634,13 +574,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 37|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -664,16 +604,16 @@ MonoBehaviour:
Data: levelDisplayDigitsContainer
- Name: $v
Entry: 7
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: levelDisplayDigitsContainer
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
Data: 3
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -688,13 +628,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 40|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 36|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -718,16 +658,16 @@ MonoBehaviour:
Data: extraLifeIndicatorsContainer
- Name: $v
Entry: 7
Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: extraLifeIndicatorsContainer
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
Data: 3
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
Data: 3
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -742,13 +682,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 43|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 39|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -772,13 +712,13 @@ MonoBehaviour:
Data: levelDisplayDigitAnimators
- Name: $v
Entry: 7
Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: levelDisplayDigitAnimators
- Name: <UserType>k__BackingField
Entry: 7
Data: 45|System.RuntimeType, mscorlib
Data: 41|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator[], UnityEngine.AnimationModule
@@ -787,7 +727,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 45
Data: 41
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -802,7 +742,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -826,13 +766,13 @@ MonoBehaviour:
Data: levelDisplayDigitRenderers
- Name: $v
Entry: 7
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: levelDisplayDigitRenderers
- Name: <UserType>k__BackingField
Entry: 7
Data: 48|System.RuntimeType, mscorlib
Data: 44|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Renderer[], UnityEngine.CoreModule
@@ -841,7 +781,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 48
Data: 44
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -856,7 +796,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -880,13 +820,13 @@ MonoBehaviour:
Data: extraLifeIndicators
- Name: $v
Entry: 7
Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: extraLifeIndicators
- Name: <UserType>k__BackingField
Entry: 7
Data: 51|System.RuntimeType, mscorlib
Data: 47|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
@@ -895,7 +835,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 51
Data: 47
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -910,7 +850,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 52|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -934,13 +874,13 @@ MonoBehaviour:
Data: label1UPVisible
- Name: $v
Entry: 7
Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: label1UPVisible
- Name: <UserType>k__BackingField
Entry: 7
Data: 54|System.RuntimeType, mscorlib
Data: 50|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
@@ -949,7 +889,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 54
Data: 50
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -964,7 +904,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -988,16 +928,16 @@ MonoBehaviour:
Data: label1UPTextBlinking
- Name: $v
Entry: 7
Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: label1UPTextBlinking
- Name: <UserType>k__BackingField
Entry: 9
Data: 54
Data: 50
- Name: <SystemType>k__BackingField
Entry: 9
Data: 54
Data: 50
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1012,7 +952,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 53|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -1033,16 +973,16 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: labelBlinkTimer
Data: labelBlinkToggleInterval
- Name: $v
Entry: 7
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: labelBlinkTimer
Data: labelBlinkToggleInterval
- Name: <UserType>k__BackingField
Entry: 7
Data: 59|System.RuntimeType, mscorlib
Data: 55|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
@@ -1051,7 +991,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 59
Data: 55
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1066,7 +1006,55 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- 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: labelBlinkTimer
- Name: $v
Entry: 7
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: labelBlinkTimer
- Name: <UserType>k__BackingField
Entry: 9
Data: 55
- 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: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0

View File

@@ -1,9 +1,12 @@
using UnityEngine;
using TMPro;
namespace Marro.PacManUdon
namespace Marro.PacManUdon
{
public class StatusDisplay : SyncedObject
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using TMPro;
public class StatusDisplay : UdonSharpBehaviour
{
[SerializeField] private Transform scoreDisplayGroup;
[SerializeField] private TMP_Text label1UPText;
@@ -25,7 +28,7 @@ namespace Marro.PacManUdon
private bool label1UPVisible;
private bool label1UPTextBlinking;
private const float labelBlinkToggleInterval = 0.26666667f;
private float labelBlinkToggleInterval = 0.26666667f;
private float labelBlinkTimer;
public void Initialize()
@@ -50,11 +53,11 @@ namespace Marro.PacManUdon
SetLabel1UPTextBlinking(false);
}
public override void SyncedUpdate()
void Update()
{
if (label1UPTextBlinking)
{
labelBlinkTimer += networkManager.SyncedDeltaTime;
labelBlinkTimer += Time.deltaTime;
if (labelBlinkTimer > labelBlinkToggleInterval)
{
labelBlinkTimer -= labelBlinkToggleInterval;

View File

@@ -1,15 +0,0 @@
using UdonSharp;
namespace Marro.PacManUdon
{
public abstract class SyncedObject : UdonSharpBehaviour
{
public NetworkManager networkManager;
public virtual void SyncedUpdate() { }
public virtual void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType) { }
public virtual bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType) { return false; }
protected void SubscribeToEvent(NetworkEventType eventType) => networkManager.SubscribeToEvent(this, eventType);
}
}

View File

@@ -10,17 +10,17 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: MazeDefinitionGenerator
m_Name: Teleporter
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: ea99e044f80fed446bb669640608f521, type: 2}
serializedUdonProgramAsset: {fileID: 11400000, guid: 1589eb7cce8925e4da3272208dfa87f4, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 30a9bec71a4b36a41a9b6ee899bef38c, type: 3}
sourceCsScript: {fileID: 11500000, guid: aae1c5d18ae01b3488b54c72e6f1edf6, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 1069201558343068808
scriptID: -7788394196284941649
serializationData:
SerializedFormat: 2
SerializedBytes:
@@ -49,19 +49,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: bonusFruit
Data: direction
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: bonusFruit
Data: direction
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp
Data: Marro.PacManUdon.Direction, Assembly-CSharp
- Name:
Entry: 8
Data:
@@ -70,7 +70,7 @@ MonoBehaviour:
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
@@ -91,7 +91,13 @@ MonoBehaviour:
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -109,25 +115,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: pelletManager
Data: target
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: pelletManager
Data: target
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.CollisionManager, Assembly-CSharp
Data: UnityEngine.Transform, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Data: 8
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -142,10 +148,16 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 909752e684c57f24093795e3ba5e2c80
guid: c6e306d768eba5b469eea599abcf4800
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -0,0 +1,63 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
enum Direction
{
Any,
Up,
Left,
Down,
Right
}
public class Teleporter : UdonSharpBehaviour
{
[SerializeField] private Direction direction = Direction.Any;
[SerializeField] private Transform target;
void OnTriggerEnter(Collider other)
{
GridMover gridMover = other.gameObject.GetComponent<GridMover>();
if (gridMover == null)
{
return;
}
switch (direction)
{
case Direction.Up:
if (gridMover.GetDirection().y < 0)
{
return;
}
break;
case Direction.Down:
if (gridMover.GetDirection().y > 0)
{
return;
}
break;
case Direction.Left:
if (gridMover.GetDirection().x > 0)
{
return;
}
break;
case Direction.Right:
if (gridMover.GetDirection().x < 0)
{
return;
}
break;
default:
break;
}
gridMover.SetPosition(gridMover.GetPosition() + (Vector2)(target.localPosition - transform.localPosition));
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d09fe6fd5a83df9468f5ffcb43d73af3
guid: aae1c5d18ae01b3488b54c72e6f1edf6
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,65 @@
// // 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,5 +1,5 @@
fileFormatVersion: 2
guid: 30a9bec71a4b36a41a9b6ee899bef38c
guid: 789dbd838d9dd5645852b3bda8c5a161
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 1ab80220efbebb2489a3218f3ee9b00b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,109 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ColoredTexture
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Color
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 2235177317997810699}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1107 &2235177317997810699
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 6251436573727931732}
m_Position: {x: 384.82895, y: 133.70117, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 6251436573727931732}
--- !u!1102 &6251436573727931732
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Blend Tree
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7315205519034161812}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!206 &7315205519034161812
BlendTree:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Blend Tree
m_Childs:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: f06a4450a22bb184bb3881fbc7ddc36f, type: 2}
m_Threshold: 0
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: Color
m_Mirror: 0
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 152a2df117ac1c948b25f28a386ac289, type: 2}
m_Threshold: 1
m_Position: {x: 0, y: 0}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: Color
m_Mirror: 0
m_BlendParameter: Color
m_BlendParameterY: Blend
m_MinThreshold: 0
m_MaxThreshold: 1
m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0
m_BlendType: 0

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 72593807222e776478e455c600f7ccf9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,206 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GreenTexture
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
m_PPtrCurves: []
m_SampleRate: 1
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 2526845255
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
typeID: 114
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 0
attribute: 4215373228
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
typeID: 114
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 0
attribute: 2334886179
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
typeID: 114
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

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

View File

@@ -1,204 +0,0 @@
using Marro.PacManUdon;
using UdonSharp;
using UnityEngine;
using UnityEngine.UIElements;
using VRC.SDKBase;
using VRC.Udon;
namespace Marro.PacManUdon.Dev
{
enum CollisionMap
{
Wall = 0x00,
Open = 0xFF,
Tunnel = 0x61,
HorizontalOnly = 0x56,
}
public class MazeDefinitionGenerator : UdonSharpBehaviour
{
public BonusFruit bonusFruit;
public CollisionManager pelletManager;
const int width = 32;
const int height = 32;
void Start()
{
PrintPelletMap();
PrintMazeMap();
}
private void PrintPelletMap()
{
var pellets = pelletManager.gameObject.GetComponentsInChildren<Pellet>(includeInactive: true);
int[] map = new int[width * height];
int[] pelletLocations = new int[pellets.Length];
for (int i = 0; i < map.Length; i++)
{
map[i] = (int)PacManConsumableType.None;
}
for (int i = 0; i < pellets.Length; i++)
{
Pellet pellet = pellets[i];
var position = GridMover.PositionToGrid(new Vector2(pellet.transform.localPosition.x, pellet.transform.localPosition.y));
var index = (int)position.x + (int)position.y * width;
map[index] = i;
pelletLocations[i] = index;
}
WriteBonusFruitTiles(map);
PrintMap(map, width);
PrintMap(pelletLocations, 16);
}
private void WriteBonusFruitTiles(int[] map)
{
var position = GridMover.PositionToGrid(new Vector2(bonusFruit.transform.localPosition.x, bonusFruit.transform.localPosition.y));
var leftTileIndex = CollisionManager.GetTilemapIndex(position);
map[leftTileIndex] = (int)PacManConsumableType.FruitLeft;
var rightTileIndex = leftTileIndex - 1;
map[rightTileIndex] = (int)PacManConsumableType.FruitRight;
}
private static void PrintMazeMap()
{
int[] map = new int[width * height];
var collisionMap = GetCollisionMap();
for (int i = 0; i < map.Length; i++)
{
byte result = 0;
var tile = GetTileAtIndex(collisionMap, i);
if (tile == (byte)CollisionMap.Wall)
{
result |= (byte)PacManCollisionInfoType.Wall;
}
if (tile == (byte)CollisionMap.Tunnel)
{
result |= (byte)PacManCollisionInfoType.Tunnel;
}
if (tile == (byte)CollisionMap.HorizontalOnly)
{
result |= (byte)PacManCollisionInfoType.HorizontalOnly;
}
result |= GetGhostTurnInformation(collisionMap, i, width, height);
map[i] = result;
}
PrintMap(map, width);
}
private static byte GetGhostTurnInformation(byte[] collisionMap, int i, int width, int height)
{
byte result = 0;
var totalAvailableDirections = 0;
if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.up, width, height)) != (byte)CollisionMap.Wall)
{
result |= (byte)Direction.Up;
totalAvailableDirections += 1;
}
if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.down, width, height)) != (byte)CollisionMap.Wall)
{
result |= (byte)Direction.Down;
totalAvailableDirections += 1;
}
if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.left, width, height)) != (byte)CollisionMap.Wall)
{
result |= (byte)Direction.Left;
totalAvailableDirections += 1;
}
if (GetTileAtIndex(collisionMap, GetTilemapIndex(i, Vector2.right, width, height)) != (byte)CollisionMap.Wall)
{
result |= (byte)Direction.Right;
totalAvailableDirections += 1;
}
if (totalAvailableDirections < 2
|| result == 0b0011 || result == 0b1100)
{
result |= (byte)PacManCollisionInfoType.NoTurn;
}
return result;
}
private static int GetTilemapIndex(int index, Vector2 direction, int width, int height)
{
var position = new Vector2(index % width, index / width) + direction;
var result = ((int)position.x + width) % width + ((int)position.y + height) % height * width;
return result;
}
private static void PrintMap(int[] map, int width)
{
var result = "";
for (int i = 0; i < map.Length; i++)
{
if (map[i] < 0)
{
result += $"{map[i]:00}, ";
}
else
{
result += $"{map[i]:000}, ";
}
if (i % width == width - 1)
{
result += "\n";
}
}
Debug.Log(result);
}
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,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x56, 0xff, 0xff, 0x56, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x56, 0xff, 0xff, 0x56, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 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

@@ -1,616 +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: NetworkManagerSyncTester
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: b33acf2ffaef28f49ba36d29b13cf487, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: cbbf384cde136444d9f640ff9f3445cf, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -7942820763917989394
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: 10
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: networkManager1
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager1
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager, 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: 7
Data:
- Name: $k
Entry: 1
Data: gridMovers1
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: gridMovers1
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.GridMover[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 9|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
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 11|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: networkManager2
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManager2
- Name: <UserType>k__BackingField
Entry: 9
Data: 3
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 14|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: gridMovers2
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: gridMovers2
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
- Name: <SystemType>k__BackingField
Entry: 9
Data: 9
- 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: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 17|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: debugImageToIndicateSynced
- Name: $v
Entry: 7
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: debugImageToIndicateSynced
- Name: <UserType>k__BackingField
Entry: 7
Data: 19|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 19
- 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: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 21|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: captureTimes
- Name: $v
Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: captureTimes
- Name: <UserType>k__BackingField
Entry: 7
Data: 23|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32[], mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 23
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: positionCaptures
- Name: $v
Entry: 7
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: positionCaptures
- Name: <UserType>k__BackingField
Entry: 7
Data: 26|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector2[][], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 27|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Object[], 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: false
- Name: _fieldAttributes
Entry: 7
Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: ownerIndex
- Name: $v
Entry: 7
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ownerIndex
- Name: <UserType>k__BackingField
Entry: 7
Data: 30|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 30
- 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: 7
Data:
- Name: $k
Entry: 1
Data: remoteIndex
- Name: $v
Entry: 7
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: remoteIndex
- Name: <UserType>k__BackingField
Entry: 9
Data: 30
- Name: <SystemType>k__BackingField
Entry: 9
Data: 30
- 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: previousCaptureTime
- Name: $v
Entry: 7
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: previousCaptureTime
- Name: <UserType>k__BackingField
Entry: 9
Data: 30
- Name: <SystemType>k__BackingField
Entry: 9
Data: 30
- 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: 35|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:
- Name:
Entry: 8
Data:

View File

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

View File

@@ -1,124 +0,0 @@
using Marro.PacManUdon;
using Newtonsoft.Json.Linq;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class NetworkManagerSyncTester : UdonSharpBehaviour
{
[SerializeField] NetworkManager networkManager1;
[SerializeField] GridMover[] gridMovers1;
[SerializeField] NetworkManager networkManager2;
[SerializeField] GridMover[] gridMovers2;
[SerializeField] Animator debugImageToIndicateSynced;
private int[] captureTimes = new int[1000];
private Vector2[][] positionCaptures = new Vector2[1000][];
private int ownerIndex = -1;
private int remoteIndex = 0;
private int previousCaptureTime = -1;
public void Update()
{
if (!networkManager1.Synced || !networkManager2.Synced)
{
ownerIndex = -1;
remoteIndex = 0;
return;
}
var ownerTime = networkManager1.SyncedTimeTicks;
if (ownerTime > previousCaptureTime)
{
IncrementIndex(ref ownerIndex);
captureTimes[ownerIndex] = ownerTime;
previousCaptureTime = ownerTime;
positionCaptures[ownerIndex] = GetPositions(gridMovers1);
}
var remoteTime = networkManager2.SyncedTimeTicks;
while (captureTimes[remoteIndex] < remoteTime && remoteIndex != ownerIndex)
{
DiscardCapture();
}
//Debug.Log($"ownerTime: {ownerTime}, remoteTime: {remoteTime}, ownerIndex: {ownerIndex} ({captureTimes[ownerIndex]}), remoteIndex: {remoteIndex} ({captureTimes[remoteIndex]})");
if (captureTimes[remoteIndex] == remoteTime)
{
bool equal = IsEqual(remoteIndex, remoteTime);
SetIndicator(equal);
DiscardCapture();
}
}
private void DiscardCapture()
{
positionCaptures[remoteIndex] = null;
IncrementIndex(ref remoteIndex);
}
private bool IsEqual(int index, int time)
{
var equal = true;
var positions1 = positionCaptures[index];
var positions2 = GetPositions(gridMovers2);
for (int i = 0; i < positions1.Length; i++)
{
var gridMover1 = gridMovers1[i];
var gridMover1Position = positions1[i];
var gridMover2 = gridMovers2[i];
var gridMover2Position = positions2[i];
if (gridMover1Position != gridMover2Position)
{
Debug.LogWarning($"{nameof(NetworkManagerSyncTester)} Desync found at {time} in {gridMover1.name}:\n {gridMover1Position} (local) != {gridMover2Position} (remote)");
//networkManager1.Pause();
//networkManager2.Pause();
equal = false;
}
}
return equal;
}
private void SetIndicator(bool value)
{
if (debugImageToIndicateSynced != null)
{
debugImageToIndicateSynced.SetFloat("Color", value ? 1 : 0);
}
}
private static Vector2[] GetPositions(GridMover[] gridMovers)
{
var length = gridMovers.Length;
var positions = new Vector2[length];
for (int i = 0; i < length; i++)
{
positions[i] = gridMovers[i].GetPosition();
}
return positions;
}
private void IncrementIndex(ref int index)
{
if (index >= positionCaptures.Length - 1)
{
index = 0;
}
else
{
index++;
}
}
}

View File

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

View File

@@ -1,340 +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: NetworkManagerTester
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 2a95858b6f853584c8e55a5140383df5, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 8261cb80d1b7e5f45b0b9afd3f6bb801, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 3371975218947168961
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: 5
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: networkManagers
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: networkManagers
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: Marro.PacManUdon.NetworkManager[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|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
- 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: interval
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: interval
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
- 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: 7
Data:
- Name: $k
Entry: 1
Data: ownerIndex
- Name: $v
Entry: 7
Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ownerIndex
- Name: <UserType>k__BackingField
Entry: 7
Data: 12|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 12
- 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: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 14|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: countdown
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: countdown
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
- 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: false
- Name: _fieldAttributes
Entry: 7
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: serializationRequested
- Name: $v
Entry: 7
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: serializationRequested
- Name: <UserType>k__BackingField
Entry: 7
Data: 18|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 18
- 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: 13
Data:
- Name:
Entry: 8
Data:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 46452140f2a4ee7458e4f4e13fea6578
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,99 +0,0 @@
using Marro.PacManUdon;
using System;
using UdonSharp;
using UnityEngine;
public class NetworkManagerTester : UdonSharpBehaviour
{
[SerializeField] private NetworkManager[] networkManagers;
[SerializeField] private float interval = 0.1f;
[SerializeField] private int ownerIndex = 0;
private float countdown = 0;
private bool serializationRequested;
private void Start()
{
foreach (var networkManager in networkManagers)
{
networkManager.SetNetworkManagerTester(this);
if (networkManager.Ready)
{
networkManager.Reset();
}
}
}
private void FixedUpdate()
{
countdown -= Time.deltaTime;
if (countdown > 0)
{
return;
}
countdown = interval;
if (!serializationRequested)
{
return;
}
var source = networkManagers[ownerIndex];
var data = PerformSerialization(source);
//Debug.Log($"{nameof(NetworkManagerTester)} Transferring {data.Length} bytes.");
foreach (var target in networkManagers)
{
if (target == source)
{
continue;
}
PerformDeserialization(target, data);
}
serializationRequested = false;
}
private byte[] PerformSerialization(NetworkManager networkManager)
{
networkManager.OnPreSerialization();
var data = networkManager.NetworkedData;
networkManager.OnPostSerializationInternal(true, data.Length) ;
return data;
}
private byte[] PerformDeserialization(NetworkManager networkManager, byte[] data)
{
networkManager.NetworkedData = data;
networkManager.OnDeserialization();
return data;
}
public bool ShouldBeOwner(NetworkManager manager) => Array.IndexOf(networkManagers, manager) == ownerIndex;
public void RequestSerializationTest()
{
serializationRequested = true;
}
public void RequestEvent(NetworkEventType eventType)
{
foreach (var target in networkManagers)
{
if (!target.IsOwner || !target.SerializationRequested)
{
continue;
}
//Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
target.RequestEventReceived(eventType);
}
}
}

View File

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

View File

@@ -1,206 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RedTexture
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
m_PPtrCurves: []
m_SampleRate: 1
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 2526845255
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
typeID: 114
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 0
attribute: 4215373228
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
typeID: 114
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 0
attribute: 2334886179
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
typeID: 114
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path:
classID: 114
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
flags: 0
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

Some files were not shown because too many files have changed in this diff Show More