From 2ccf77c0eb14b5ec510154299fa84a837d033fff Mon Sep 17 00:00:00 2001 From: Marro64 Date: Thu, 11 Jun 2026 19:24:09 +0200 Subject: [PATCH] Tools for testing --- Assets/PacManGame.prefab | 12 +- Assets/Scenes/PacMan.unity | 1038 ++++++++++++++++- Assets/Scripts/NetworkManager.asset | 481 ++++---- Assets/Scripts/NetworkManager.cs | 172 +-- .../Test stuff/NetworkManagerSyncTester.asset | 176 ++- Assets/Test stuff/NetworkManagerSyncTester.cs | 87 +- 6 files changed, 1590 insertions(+), 376 deletions(-) diff --git a/Assets/PacManGame.prefab b/Assets/PacManGame.prefab index ed99c4f..b76286f 100644 --- a/Assets/PacManGame.prefab +++ b/Assets/PacManGame.prefab @@ -10184,17 +10184,11 @@ MonoBehaviour: SerializationNodes: [] _udonSharpBackingUdonBehaviour: {fileID: 1180286844452673728} networkManager: {fileID: 0} - networkEventSubscribersFlat: - - {fileID: 7714172614521704433} - - {fileID: 7714172614521704433} - - {fileID: 7714172614521704433} - - {fileID: 7714172614521704433} - networkEventSubscribersFlatSegmentLengths: 000000000000000003000000ffffffff000000000000000000000000000000000000000000000000 root: {fileID: 6505452106475299050} - delay: 1 + delay: 50 maxEventSendTries: 3 - pingDelay: 0.3 - updateDelta: 0.016666668 + pingDelay: 15 + tickDelta: 0.016666668 DebugImageToIndicateOwner: {fileID: 3129450115522694373} DebugImageToIndicateSynced: {fileID: 762605392980976710} DebugImageToIndicateReady: {fileID: 1191965255371285111} diff --git a/Assets/Scenes/PacMan.unity b/Assets/Scenes/PacMan.unity index c23d41c..4e2a5c0 100644 --- a/Assets/Scenes/PacMan.unity +++ b/Assets/Scenes/PacMan.unity @@ -301,6 +301,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 4979601353925297299, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 7528894854307259292} m_PrefabAsset: {fileID: 0} +--- !u!114 &63452443 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7714172614521704433, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 7528894854307259292} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63452431} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d03e7ac9be6b92243a35cc0df75a2e8e, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &65516625 stripped GameObject: m_CorrespondingSourceObject: {fileID: 4073808423232294499, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -317,6 +328,17 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ac984c07ae3e9674a850c3916be56ca3, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &65516627 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1180286844452673728, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 65516625} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &66035346 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7783726316183919063, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -342,6 +364,11 @@ GameObject: m_CorrespondingSourceObject: {fileID: 6610557221546861718, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!224 &89001618 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 644674727704841727, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} --- !u!1 &92273494 stripped GameObject: m_CorrespondingSourceObject: {fileID: 1963045125815263883, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -997,6 +1024,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 109330399196804403, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!114 &217059831 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7704679238063621622, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 217059824} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &219051897 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7293350050207545893, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -1591,6 +1629,140 @@ GameObject: m_CorrespondingSourceObject: {fileID: 2068762643646008789, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!1 &353722748 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 353722749} + - component: {fileID: 353722751} + - component: {fileID: 353722750} + m_Layer: 0 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &353722749 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353722748} + 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: 483106233} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &353722750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353722748} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Synced + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &353722751 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353722748} + m_CullTransparentMesh: 1 --- !u!1 &354122472 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7320637317995385321, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -2283,6 +2455,161 @@ GameObject: m_CorrespondingSourceObject: {fileID: 4084037101917093794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 7528894854307259292} m_PrefabAsset: {fileID: 0} +--- !u!1 &483106228 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 483106233} + - component: {fileID: 483106232} + - component: {fileID: 483106231} + - component: {fileID: 483106230} + - component: {fileID: 483106229} + m_Layer: 0 + m_Name: Synced + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!95 &483106229 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 483106228} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 72593807222e776478e455c600f7ccf9, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!114 &483106230 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 483106228} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 483106231} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 65516627} + m_TargetAssemblyTypeName: + m_MethodName: SendCustomEvent + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: DoFullSync + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &483106231 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 483106228} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 35630e38b4e5ffb40b44ec5348b4333f, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &483106232 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 483106228} + m_CullTransparentMesh: 1 +--- !u!224 &483106233 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 483106228} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.000000012644042} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 353722749} + m_Father: {fileID: 89001618} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -17.00001, y: -54} + m_SizeDelta: {x: 100, y: 30} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &485307677 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3146534040629537757, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -3620,6 +3947,8 @@ GameObject: - component: {fileID: 805005471} - component: {fileID: 805005473} - component: {fileID: 805005472} + - component: {fileID: 805005475} + - component: {fileID: 805005474} m_Layer: 0 m_Name: NetworkManagerTester m_TagString: Untagged @@ -3692,8 +4021,70 @@ MonoBehaviour: networkManagers: - {fileID: 811840793} - {fileID: 65516626} - interval: 0.1 + interval: 0 ownerIndex: 0 +--- !u!114 &805005474 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 805005470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 2 + serializedProgramAsset: {fileID: 11400000, guid: b33acf2ffaef28f49ba36d29b13cf487, type: 2} + programSource: {fileID: 11400000, guid: bcf028de1e758ca45bcd8834df0b821c, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 +--- !u!114 &805005475 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 805005470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cbbf384cde136444d9f640ff9f3445cf, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 805005474} + networkManager1: {fileID: 811840793} + gridMovers1: + - {fileID: 63452443} + - {fileID: 1237257558} + - {fileID: 1910438138} + - {fileID: 1407423087} + - {fileID: 1541737191} + networkManager2: {fileID: 65516626} + gridMovers2: + - {fileID: 1366842346} + - {fileID: 1766929461} + - {fileID: 217059831} + - {fileID: 1205077370} + - {fileID: 1411581077} + debugImageToIndicateSynced: {fileID: 483106229} --- !u!1 &805185634 stripped GameObject: m_CorrespondingSourceObject: {fileID: 1928664601999823222, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -4555,6 +4946,161 @@ GameObject: m_CorrespondingSourceObject: {fileID: 4593549142533939220, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!1 &1064697924 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1064697925} + - component: {fileID: 1064697928} + - component: {fileID: 1064697927} + - component: {fileID: 1064697926} + m_Layer: 0 + m_Name: Placeholder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1064697925 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064697924} + 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: 1389974186} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1064697926 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064697924} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 1 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!114 &1064697927 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064697924} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Enter text... + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 2150773298 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 2 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 1 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1064697928 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064697924} + m_CullTransparentMesh: 1 --- !u!1 &1067739242 stripped GameObject: m_CorrespondingSourceObject: {fileID: 4500317473426682151, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -5485,10 +6031,11 @@ MonoBehaviour: _udonSharpBackingUdonBehaviour: {fileID: 1200574209} networkManager: {fileID: 0} root: {fileID: 0} - delay: 1 + delay: 50 maxEventSendTries: 3 - pingDelay: 0.3 - updateDelta: 0.016666668 + pingDelay: 15 + tickDelta: 0.016666668 + debugOutput: {fileID: 0} DebugImageToIndicateOwner: {fileID: 1745114900} DebugImageToIndicateSynced: {fileID: 0} DebugImageToIndicateReady: {fileID: 0} @@ -5612,6 +6159,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 3694438210017678001, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!114 &1205077370 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6353919794372223604, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1205077363} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1210508488 PrefabInstance: m_ObjectHideFlags: 0 @@ -5732,6 +6290,14 @@ PrefabInstance: propertyPath: serializationData.Prefab value: objectReference: {fileID: 776794315963647603, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + - target: {fileID: 795751881681854794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + propertyPath: delay + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 795751881681854794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + propertyPath: debugOutput + value: + objectReference: {fileID: 2006792950} - target: {fileID: 795751881681854794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} propertyPath: serializationData.Prefab value: @@ -6810,7 +7376,13 @@ PrefabInstance: objectReference: {fileID: 9191377896296995294, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 724421177822150835, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + insertIndex: -1 + addedObject: {fileID: 2006792949} + - targetCorrespondingSourceObject: {fileID: 644674727704841727, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + insertIndex: 6 + addedObject: {fileID: 483106233} m_AddedComponents: - targetCorrespondingSourceObject: {fileID: 760989357904163835, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} insertIndex: -1 @@ -6906,6 +7478,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 3576665465728788261, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!114 &1237257558 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2281557418868999653, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 7528894854307259292} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 384558790} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1243038672 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7085619490826564167, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -7103,6 +7686,11 @@ GameObject: m_CorrespondingSourceObject: {fileID: 5715591237709116327, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!224 &1363943286 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 724421177822150835, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} --- !u!1 &1364254242 stripped GameObject: m_CorrespondingSourceObject: {fileID: 4316783628595924802, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -7113,6 +7701,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 4979601353925297299, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!114 &1366842346 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7714172614521704433, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1366842339} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d03e7ac9be6b92243a35cc0df75a2e8e, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1368462246 stripped GameObject: m_CorrespondingSourceObject: {fileID: 4185429024602222620, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -7231,6 +7830,58 @@ Transform: m_Children: [] m_Father: {fileID: 712073434} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1389974185 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1389974186} + - component: {fileID: 1389974187} + m_Layer: 0 + m_Name: Text Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1389974186 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1389974185} + 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: + - {fileID: 1064697925} + - {fileID: 1465823363} + m_Father: {fileID: 2006792949} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -0.5} + m_SizeDelta: {x: -20, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1389974187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1389974185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3312d7739989d2b4e91e6319e9a96d76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: {x: -8, y: -5, z: -8, w: -5} + m_Softness: {x: 0, y: 0} --- !u!1 &1390266233 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3089069080869392820, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -7322,6 +7973,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 3694438210017678001, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 7528894854307259292} m_PrefabAsset: {fileID: 0} +--- !u!114 &1407423087 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6353919794372223604, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 7528894854307259292} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1407423078} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1408697865 stripped GameObject: m_CorrespondingSourceObject: {fileID: 6617131549196965745, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -7347,6 +8009,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 4054778616656183051, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!114 &1411581077 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5993614020202909646, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1411581070} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1418273771 stripped GameObject: m_CorrespondingSourceObject: {fileID: 531603117301386236, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -7593,6 +8266,140 @@ GameObject: m_CorrespondingSourceObject: {fileID: 3510552530651924412, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 7528894854307259292} m_PrefabAsset: {fileID: 0} +--- !u!1 &1465823362 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1465823363} + - component: {fileID: 1465823365} + - component: {fileID: 1465823364} + m_Layer: 0 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1465823363 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465823362} + 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: 1389974186} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1465823364 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465823362} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u200B" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 1 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1465823365 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465823362} + m_CullTransparentMesh: 1 --- !u!1 &1472000832 stripped GameObject: m_CorrespondingSourceObject: {fileID: 6334235783093999612, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -7931,6 +8738,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 355077758653607555, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 7528894854307259292} m_PrefabAsset: {fileID: 0} +--- !u!114 &1541737191 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5993614020202909646, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 7528894854307259292} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 262522556} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1551317024 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3556558624868497024, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -10017,10 +10835,6 @@ MonoBehaviour: ID: 39 SerializedTypeNames: - VRC.Udon.UdonBehaviour - - gameObject: {fileID: 805005470} - ID: 309 - SerializedTypeNames: - - VRC.Udon.UdonBehaviour - gameObject: {fileID: 2121595711} ID: 310 SerializedTypeNames: @@ -11161,6 +11975,11 @@ MonoBehaviour: ID: 594 SerializedTypeNames: - VRC.Udon.UdonBehaviour + - gameObject: {fileID: 805005470} + ID: 309 + SerializedTypeNames: + - VRC.Udon.UdonBehaviour + - VRC.Udon.UdonBehaviour portraitCameraPositionOffset: {x: 0, y: 0, z: 0} portraitCameraRotationOffset: {x: 0, y: 1, z: 0, w: -0.00000004371139} PlayerPersistence: [] @@ -11289,6 +12108,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 8413102315728467232, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 1210508488} m_PrefabAsset: {fileID: 0} +--- !u!114 &1766929461 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2281557418868999653, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 1210508488} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1766929454} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1773753006 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7955628641985366373, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -11744,6 +12574,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 8799161989223030618, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} m_PrefabInstance: {fileID: 7528894854307259292} m_PrefabAsset: {fileID: 0} +--- !u!114 &1910438138 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7704679238063621622, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + m_PrefabInstance: {fileID: 7528894854307259292} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1592985534} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ca6f74362dcf8a46b2ad3ec99e38719, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1916414808 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3975383514799343505, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -12256,6 +13097,181 @@ Transform: m_Children: [] m_Father: {fileID: 712073434} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2006792948 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2006792949} + - component: {fileID: 2006792952} + - component: {fileID: 2006792951} + - component: {fileID: 2006792950} + m_Layer: 0 + m_Name: Debug info + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2006792949 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2006792948} + 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: + - {fileID: 1389974186} + m_Father: {fileID: 1363943286} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -101} + m_SizeDelta: {x: 950, y: 400} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2006792950 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2006792948} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2006792951} + m_TextViewport: {fileID: 1389974186} + m_TextComponent: {fileID: 1465823364} + m_Placeholder: {fileID: 1064697927} + m_VerticalScrollbar: {fileID: 0} + m_VerticalScrollbarEventHandler: {fileID: 0} + m_LayoutGroup: {fileID: 0} + m_ScrollSensitivity: 1 + m_ContentType: 0 + m_InputType: 0 + m_AsteriskChar: 42 + m_KeyboardType: 0 + m_LineType: 0 + m_HideMobileInput: 0 + m_HideSoftKeyboard: 0 + m_CharacterValidation: 0 + m_RegexValue: + m_GlobalPointSize: 24 + m_CharacterLimit: 0 + m_OnEndEdit: + m_PersistentCalls: + m_Calls: [] + m_OnSubmit: + m_PersistentCalls: + m_Calls: [] + m_OnSelect: + m_PersistentCalls: + m_Calls: [] + m_OnDeselect: + m_PersistentCalls: + m_Calls: [] + m_OnTextSelection: + m_PersistentCalls: + m_Calls: [] + m_OnEndTextSelection: + m_PersistentCalls: + m_Calls: [] + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_OnTouchScreenKeyboardStatusChanged: + m_PersistentCalls: + m_Calls: [] + m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_CustomCaretColor: 0 + m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} + m_Text: + m_CaretBlinkRate: 0.85 + m_CaretWidth: 1 + m_ReadOnly: 1 + m_RichText: 1 + m_GlobalFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_OnFocusSelectAll: 1 + m_ResetOnDeActivation: 1 + m_RestoreOriginalTextOnEscape: 1 + m_isRichTextEditingAllowed: 0 + m_LineLimit: 0 + m_InputValidator: {fileID: 0} +--- !u!114 &2006792951 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2006792948} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2006792952 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2006792948} + m_CullTransparentMesh: 1 --- !u!1 &2010506950 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3647033160510177120, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} @@ -13194,6 +14210,10 @@ PrefabInstance: propertyPath: serializationData.Prefab value: objectReference: {fileID: 776794315963647603, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + - target: {fileID: 795751881681854794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} + propertyPath: delay + value: 1 + objectReference: {fileID: 0} - target: {fileID: 795751881681854794, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3} propertyPath: serializationData.Prefab value: diff --git a/Assets/Scripts/NetworkManager.asset b/Assets/Scripts/NetworkManager.asset index 55adfda..21671f2 100644 --- a/Assets/Scripts/NetworkManager.asset +++ b/Assets/Scripts/NetworkManager.asset @@ -181,7 +181,7 @@ MonoBehaviour: Data: 11|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Single, mscorlib + Data: System.Int32, mscorlib - Name: Entry: 8 Data: @@ -237,17 +237,11 @@ MonoBehaviour: Entry: 1 Data: maxEventSendTries - Name: k__BackingField - Entry: 7 - Data: 15|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 15 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -262,13 +256,13 @@ MonoBehaviour: Data: true - 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 + Data: 16|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -292,7 +286,7 @@ MonoBehaviour: Data: pingDelay - Name: $v Entry: 7 - Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: pingDelay @@ -316,13 +310,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 20|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 19|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -343,19 +337,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: updateDelta + Data: tickDelta - Name: $v Entry: 7 - Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: updateDelta + Data: tickDelta - Name: k__BackingField - Entry: 9 - Data: 11 + Entry: 7 + Data: 21|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 11 + Data: 21 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -625,19 +625,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: offsetTime + Data: startTime - Name: $v Entry: 7 Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: offsetTime + Data: startTime - Name: k__BackingField Entry: 9 - Data: 11 + Data: 21 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 21 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -673,13 +673,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: internalTime + Data: targetTicks - Name: $v Entry: 7 Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: internalTime + Data: targetTicks - Name: k__BackingField Entry: 9 Data: 11 @@ -817,13 +817,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: nextUpdateTime + Data: nextEventTime - Name: $v Entry: 7 Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: nextUpdateTime + Data: nextEventTime - Name: k__BackingField Entry: 9 Data: 11 @@ -865,13 +865,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: nextEventTime + Data: retriesWithoutSuccess - Name: $v Entry: 7 Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: nextEventTime + Data: retriesWithoutSuccess - Name: k__BackingField Entry: 9 Data: 11 @@ -913,19 +913,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: retriesWithoutSuccess + Data: hasFullSyncReady - Name: $v Entry: 7 Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: retriesWithoutSuccess + Data: hasFullSyncReady - Name: k__BackingField Entry: 9 - Data: 15 + Data: 25 - Name: k__BackingField Entry: 9 - Data: 15 + Data: 25 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -961,13 +961,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: hasFullSyncReady + Data: serializationRequested - Name: $v Entry: 7 Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: hasFullSyncReady + Data: serializationRequested - Name: k__BackingField Entry: 9 Data: 25 @@ -1009,19 +1009,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: serializationRequested + Data: eventsToSend - Name: $v Entry: 7 Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: serializationRequested + Data: eventsToSend - Name: k__BackingField - Entry: 9 - Data: 25 + Entry: 7 + Data: 55|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: Marro.PacManUdon.NetworkEventType[], Assembly-CSharp + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 25 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1036,7 +1042,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1057,25 +1063,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsToSend + Data: eventsToSendIndex - Name: $v Entry: 7 - Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventsToSend + Data: eventsToSendIndex - Name: k__BackingField - Entry: 7 - Data: 57|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: Marro.PacManUdon.NetworkEventType[], Assembly-CSharp - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 32 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1111,19 +1111,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsToSendIndex + Data: eventsQueue - Name: $v Entry: 7 Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventsToSendIndex + Data: eventsQueue - Name: k__BackingField - Entry: 9 - Data: 15 + Entry: 7 + Data: 60|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Byte[][], mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 15 + Data: 29 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1138,7 +1144,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1159,25 +1165,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsQueue + Data: eventsQueueIndex - Name: $v Entry: 7 - Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventsQueue + Data: eventsQueueIndex - Name: k__BackingField - Entry: 7 - Data: 62|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Byte[][], mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 29 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1213,19 +1213,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsQueueIndex + Data: eventsQueueIndexAtLastTransmission - Name: $v Entry: 7 Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventsQueueIndex + Data: eventsQueueIndexAtLastTransmission - Name: k__BackingField Entry: 9 - Data: 15 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 15 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1261,19 +1261,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventsQueueIndexAtLastTransmission + Data: eventTransmissionHistory - Name: $v Entry: 7 Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventsQueueIndexAtLastTransmission + Data: eventTransmissionHistory - Name: k__BackingField Entry: 9 - Data: 15 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 15 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1309,19 +1309,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventTransmissionHistory + Data: eventTransmissionHistoryIndex - Name: $v Entry: 7 Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventTransmissionHistory + Data: eventTransmissionHistoryIndex - Name: k__BackingField Entry: 9 - Data: 32 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 32 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1357,19 +1357,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: eventTransmissionHistoryIndex + Data: lastEventTransmissionTime - Name: $v Entry: 7 Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: eventTransmissionHistoryIndex + Data: lastEventTransmissionTime - Name: k__BackingField Entry: 9 - Data: 15 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 15 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1405,64 +1405,16 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: lastEventTransmissionTime + Data: lastEventId - Name: $v Entry: 7 Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: lastEventTransmissionTime - - Name: k__BackingField - Entry: 9 - Data: 11 - - Name: k__BackingField - Entry: 9 - Data: 11 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 1 - Data: lastEventId - - Name: $v - Entry: 7 - Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: lastEventId - Name: k__BackingField Entry: 7 - Data: 75|System.RuntimeType, mscorlib + Data: 73|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Byte, mscorlib @@ -1471,7 +1423,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 75 + Data: 73 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1486,7 +1438,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 76|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -1510,13 +1462,13 @@ MonoBehaviour: Data: networkedData - Name: $v Entry: 7 - Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: networkedData - Name: k__BackingField Entry: 7 - Data: 78|System.RuntimeType, mscorlib + Data: 76|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Byte[], mscorlib @@ -1525,7 +1477,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 78 + Data: 76 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1540,13 +1492,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 79|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 80|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 78|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -1570,7 +1522,7 @@ MonoBehaviour: Data: ready - Name: $v Entry: 7 - Data: 81|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: ready @@ -1592,6 +1544,54 @@ MonoBehaviour: - Name: k__BackingField Entry: 5 Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 80|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: synced + - Name: $v + Entry: 7 + Data: 81|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: synced + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 9 + Data: 25 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false - Name: _fieldAttributes Entry: 7 Data: 82|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib @@ -1615,19 +1615,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: synced + Data: k__BackingField - Name: $v Entry: 7 Data: 83|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: synced + Data: k__BackingField - Name: k__BackingField Entry: 9 - Data: 25 + Data: 11 - Name: k__BackingField Entry: 9 - Data: 25 + Data: 11 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1672,10 +1672,10 @@ MonoBehaviour: Data: k__BackingField - Name: k__BackingField Entry: 9 - Data: 11 + Data: 21 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 21 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1711,19 +1711,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: k__BackingField + Data: k__BackingField - Name: $v Entry: 7 Data: 87|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: k__BackingField + Data: k__BackingField - Name: k__BackingField Entry: 9 - Data: 11 + Data: 25 - Name: k__BackingField Entry: 9 - Data: 11 + Data: 25 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1759,13 +1759,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: k__BackingField + Data: isOwner - Name: $v Entry: 7 Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: k__BackingField + Data: isOwner - Name: k__BackingField Entry: 9 Data: 25 @@ -1807,19 +1807,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: isOwner + Data: debugOutput - Name: $v Entry: 7 Data: 91|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: isOwner + Data: debugOutput - Name: k__BackingField - Entry: 9 - Data: 25 + Entry: 7 + Data: 92|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TMPro.TMP_InputField, Unity.TextMeshPro + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 25 + Data: 92 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1831,13 +1837,19 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 5 - Data: false + Data: true - Name: _fieldAttributes Entry: 7 - Data: 92|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 93|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 0 + Data: 1 + - Name: + Entry: 7 + Data: 94|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: Entry: 13 Data: @@ -1858,13 +1870,13 @@ MonoBehaviour: Data: DebugImageToIndicateOwner - Name: $v Entry: 7 - Data: 93|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: DebugImageToIndicateOwner - Name: k__BackingField Entry: 7 - Data: 94|System.RuntimeType, mscorlib + Data: 96|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Animator, UnityEngine.AnimationModule @@ -1873,7 +1885,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 94 + Data: 96 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1888,13 +1900,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 95|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 97|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 96|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 98|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -1918,16 +1930,16 @@ MonoBehaviour: Data: DebugImageToIndicateSynced - Name: $v Entry: 7 - Data: 97|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: DebugImageToIndicateSynced - Name: k__BackingField Entry: 9 - Data: 94 + Data: 96 - Name: k__BackingField Entry: 9 - Data: 94 + Data: 96 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1942,68 +1954,69 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 98|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 99|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: DebugImageToIndicateReady - - Name: $v - Entry: 7 - Data: 100|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: DebugImageToIndicateReady - - Name: k__BackingField - Entry: 9 - Data: 94 - - Name: k__BackingField - Entry: 9 - Data: 94 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 6 - Data: - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: true - - Name: _fieldAttributes - Entry: 7 - Data: 101|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], + Data: 100|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 102|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 101|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: DebugImageToIndicateReady + - Name: $v + Entry: 7 + Data: 102|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: DebugImageToIndicateReady + - Name: k__BackingField + Entry: 9 + Data: 96 + - Name: k__BackingField + Entry: 9 + Data: 96 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 103|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], + mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 104|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -2027,13 +2040,13 @@ MonoBehaviour: Data: tester - Name: $v Entry: 7 - Data: 103|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 105|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: tester - Name: k__BackingField Entry: 7 - Data: 104|System.RuntimeType, mscorlib + Data: 106|System.RuntimeType, mscorlib - Name: Entry: 1 Data: NetworkManagerTester, Assembly-CSharp @@ -2057,7 +2070,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 105|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], + Data: 107|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 diff --git a/Assets/Scripts/NetworkManager.cs b/Assets/Scripts/NetworkManager.cs index 5cf5a17..1500f5e 100644 --- a/Assets/Scripts/NetworkManager.cs +++ b/Assets/Scripts/NetworkManager.cs @@ -1,4 +1,6 @@ -using System; +using Newtonsoft.Json.Linq; +using System; +using System.Numerics; using System.Text; using TMPro; using UdonSharp; @@ -52,9 +54,9 @@ namespace Marro.PacManUdon /// [SerializeField] private GameObject root; /// - /// The delay at which the receiving side replays events. + /// The delay in ticks at which the receiving side replays events. /// - [SerializeField] private float delay = 1f; + [SerializeField] private int delay = 50; /// /// The maximum amount of times a message is sent. /// @@ -62,11 +64,11 @@ namespace Marro.PacManUdon /// /// How long to wait since last message to send next ping. /// - [SerializeField] private float pingDelay = 0.3f; + [SerializeField] private int pingDelay = 15; /// /// The time delta at which updates occur. /// - [SerializeField] private float updateDelta = 0.0166666667f; + [SerializeField] private float tickDelta = 0.0166666667f; #endregion #region Constants @@ -123,13 +125,14 @@ namespace Marro.PacManUdon private SyncedObject[] syncedUpdateSubscribers; /// - /// Offset from system time to network time, including delay. + /// The that corresponds to tick 0. /// - private float offsetTime; + private float startTime; + /// - /// Time since last full sync, captured when this FixedUpdate started, with network delay applied. + /// Time in ticks since start of game. /// - private float internalTime; + private int targetTicks; /// /// True if time is paused @@ -142,13 +145,9 @@ namespace Marro.PacManUdon private bool stepNext; /// - /// Time at which the next update should occur. + /// Time at which next received event occured, in ticks. /// - private float nextUpdateTime; - /// - /// Time at which next received event occured. - /// - private float nextEventTime; + private int nextEventTime; /// /// Amounot of retries in a row without a successful sync. @@ -196,9 +195,9 @@ namespace Marro.PacManUdon /// private int eventTransmissionHistoryIndex; /// - /// Time of last event transmission. + /// Time of last event transmission, in ticks. /// - private float lastEventTransmissionTime; + private int lastEventTransmissionTime; /// @@ -251,14 +250,18 @@ namespace Marro.PacManUdon private bool synced = false; /// - /// The time since last full sync which is currently being simulated. + /// The time since start of game, in ticks. + /// + public int SyncedTimeTicks { get; private set; } + /// + /// The time since start of game which is currently being simulated. /// public float SyncedTime { get; private set; } /// /// Time since the last simulation, in seconds. /// - public float SyncedDeltaTime { get; private set; } + public float SyncedDeltaTime => tickDelta; /// /// Is the current simulation to prepare for applying a network event? @@ -355,11 +358,10 @@ namespace Marro.PacManUdon retriesWithoutSuccess = 0; hasFullSyncReady = false; - offsetTime = Time.fixedTime; - internalTime = 0; + targetTicks = 0; + startTime = Time.fixedTime; SyncedTime = 0; - SyncedDeltaTime = Time.fixedDeltaTime; - nextUpdateTime = SyncedTime; + SyncedTimeTicks = 0; Ready = true; @@ -373,11 +375,16 @@ namespace Marro.PacManUdon RequestEvent(NetworkEventType.FullSync); } - Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized, time offset: {offsetTime}"); + Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized"); } public void Update() { + if (debugOutput != null) + { + WriteDebugOutput(debugOutput); + } + if (!initialized) { return; @@ -387,35 +394,12 @@ namespace Marro.PacManUdon UpdateInternalTime(); // Forwards simulated time by updateDelta until we're caught up - while (nextUpdateTime <= internalTime) + while (SyncedTimeTicks <= targetTicks) { PerformFixedSyncedUpdate(); } } - private void UpdateInternalTime() - { - var delta = Time.fixedTime - offsetTime - internalTime; - - if (!paused) - { - // Continue time like normal - internalTime += delta; - } - else if (paused && !stepNext) - { - // Since we're paused, increase our offset from Unity's time - offsetTime += delta; - } - else - { - // Step forward by exactly updateDelta, apply the remainder to our offset - offsetTime += delta - updateDelta; - internalTime += updateDelta; - stepNext = false; - } - } - private void PerformFixedSyncedUpdate() { if (Ready) @@ -431,9 +415,8 @@ namespace Marro.PacManUdon } } - ProgressSyncedTime(nextUpdateTime); + ProgressSyncedTime(); CallSyncedUpdate(); - nextUpdateTime = SyncedTime + updateDelta; } private void CallSyncedUpdate() @@ -555,7 +538,7 @@ namespace Marro.PacManUdon return; } - var timestamp = SyncedTime; + var timestamp = SyncedTimeTicks; var eventId = GetNextEventId(lastEventId); @@ -593,7 +576,7 @@ namespace Marro.PacManUdon retriesWithoutSuccess = 0; // We had success! } - private static void InitializeEvent(NetworkEventType eventType, float timestamp, byte eventId, out byte[] data, out int index) + private static void InitializeEvent(NetworkEventType eventType, int timestamp, byte eventId, out byte[] data, out int index) { data = new byte[MaxEventSize]; @@ -640,7 +623,7 @@ namespace Marro.PacManUdon private void ProgressPingTime() { if (eventsQueueIndex > 0 && !serializationRequested - && internalTime - lastEventTransmissionTime >= pingDelay) + && targetTicks - lastEventTransmissionTime >= pingDelay) { RequestSerializationForEvents(); } @@ -695,7 +678,7 @@ namespace Marro.PacManUdon // If there was a full sync in the queue, it has now been transmitted at least once hasFullSyncReady = false; - lastEventTransmissionTime = internalTime; + lastEventTransmissionTime = targetTicks; } #endregion @@ -811,7 +794,7 @@ namespace Marro.PacManUdon QueueEventInBuffer(@event); // Set this event to play after the default delay - nextEventTime = internalTime + delay; + nextEventTime = targetTicks + delay; hasFullSyncReady = true; @@ -822,7 +805,7 @@ namespace Marro.PacManUdon { IsEventUpdate = true; - while (eventsQueueIndex > 0 && nextEventTime <= SyncedTime) + while (eventsQueueIndex > 0 && nextEventTime <= SyncedTimeTicks) { var success = ApplyEvent(eventsQueue[0]); @@ -847,11 +830,16 @@ namespace Marro.PacManUdon { SyncToTimestamp(timestamp); } + else if (timestamp < SyncedTimeTicks) + { + Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Next received event is in the past! " + + $"{nameof(nextEventTime)}: {nextEventTime} < {nameof(SyncedTimeTicks)}: {SyncedTimeTicks}."); + HandleError(true); + return false; + } var index = (int)HeaderLength; // Skip header - ProgressSyncedTime(timestamp); - var subscribers = GetEventSubscribers(eventType); Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) ApplyEvent with dt {SyncedDeltaTime}"); @@ -890,7 +878,7 @@ namespace Marro.PacManUdon Synced = true; } - Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming eventof type {eventType}! Total {index} bytes."); + Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes."); retriesWithoutSuccess = 0; // We had success! @@ -951,30 +939,38 @@ namespace Marro.PacManUdon #endregion #region Time - private void ProgressSyncedTime(float newTime) + private void UpdateInternalTime() { - //Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) updating SyncedTime from {SyncedTime} to {newTime}"); - SyncedDeltaTime = newTime - SyncedTime; - - if (SyncedDeltaTime < 0) + if (paused && !stepNext) { - Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Negative Dt: {SyncedDeltaTime}! Going from {SyncedTime} to {newTime}, IsEventUpdate: {IsEventUpdate}"); + return; } - SyncedTime = newTime; + if (paused && stepNext) + { + targetTicks++; + stepNext = false; + return; + } + + targetTicks = (int)((Time.fixedTime - startTime) / tickDelta); } - private void SyncToTimestamp(float timestamp) + private void ProgressSyncedTime() { - var oldOffset = offsetTime; - offsetTime = Time.fixedTime - timestamp; + SyncedTimeTicks++; + SyncedTime = SyncedTimeTicks * tickDelta; + } - var delta = offsetTime - oldOffset; - internalTime -= delta; - SyncedTime -= delta; - nextEventTime -= delta; + private void SyncToTimestamp(int timestamp) + { + startTime = Time.fixedTime - timestamp * tickDelta; + targetTicks = timestamp; + SyncedTimeTicks = timestamp; + SyncedTime = SyncedTimeTicks * tickDelta; + nextEventTime = timestamp; - Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, current time is {Time.fixedTime}, offsetTime is now {offsetTime}, internalTime is now {internalTime}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}"); + Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, internalTime is now {targetTicks}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}"); } private void UpdateNextEventTime() @@ -993,9 +989,9 @@ namespace Marro.PacManUdon return; } - if (nextEventTime < SyncedTime) + if (nextEventTime < SyncedTimeTicks) { - Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) New event timestamp is earlier than our current synced time by {SyncedTime - nextEventTime} seconds! nextEventTime: {nextEventTime} SyncedTime: {SyncedTime}, internalTime: {internalTime}"); + Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) New event timestamp is earlier than our current synced time by {SyncedTime - nextEventTime} seconds! nextEventTime: {nextEventTime} SyncedTime: {SyncedTime}, internalTime: {targetTicks}"); HandleError(true); return; } @@ -1026,8 +1022,8 @@ namespace Marro.PacManUdon private static NetworkEventType GetEventTypeFromHeader(byte[] @event, int eventIndex = 0) => (NetworkEventType)@event[eventIndex + HeaderEventTypeIndex]; - private static float GetTimestampFromHeader(byte[] @event, int eventIndex = 0) => - BitConverter.ToSingle(@event, eventIndex + HeaderTimestampIndex); + private static int GetTimestampFromHeader(byte[] @event, int eventIndex = 0) => + BitConverter.ToInt32(@event, eventIndex + HeaderTimestampIndex); private static byte GetEventIdFromHeader(byte[] @event, int eventIndex = 0) => @event[eventIndex + HeaderEventIdIndex]; @@ -1107,6 +1103,11 @@ namespace Marro.PacManUdon Array.Copy(data, start, result, 0, length); return result; } + + private static float RoundDown(float value, float precision) + { + return (float)(Math.Floor(value / precision) * precision); + } #endregion #region SyncedData @@ -1137,20 +1138,20 @@ namespace Marro.PacManUdon #region Debug public void SimulateSyncToTimestamp(float timestamp) { - SyncToTimestamp(timestamp); + //SyncToTimestamp(timestamp); } public void WriteDebugOutput(TMP_InputField debugOutput) { - debugOutput.text += $"{nameof(NetworkManager)}:\n" + + debugOutput.text = $"{nameof(NetworkManager)}:\n" + $"IsOwner: {IsOwner}\n" + $"Ready: {Ready}\n" + $"Synced: {Synced}\n" + $"hasFullSyncReady: {hasFullSyncReady}\n" + - $"lastEventId: {lastEventId}" + + $"lastEventId: {lastEventId}\n" + $"Time.fixedTime: {Time.fixedTime}\n" + - $"offsetTime: {offsetTime}\n" + - $"internalTime: {internalTime}\n" + + $"startTime: {startTime}\n" + + $"targetTicks: {targetTicks}\n" + $"SyncedTime: {SyncedTime}\n" + $"Dt: {SyncedDeltaTime}\n" + $"BufferIndex: {eventsQueueIndex}\n" + @@ -1158,6 +1159,11 @@ namespace Marro.PacManUdon $"\n"; } + /// + /// Text field to display debug info in. + /// + [SerializeField] private TMP_InputField debugOutput; + /// /// An animator which visualizes whether the current perspective is the owner. /// diff --git a/Assets/Test stuff/NetworkManagerSyncTester.asset b/Assets/Test stuff/NetworkManagerSyncTester.asset index 3fa5f59..af8e080 100644 --- a/Assets/Test stuff/NetworkManagerSyncTester.asset +++ b/Assets/Test stuff/NetworkManagerSyncTester.asset @@ -43,7 +43,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 7 + Data: 10 - Name: Entry: 7 Data: @@ -349,19 +349,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: captureTime + Data: captureTimes - Name: $v Entry: 7 Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: captureTime + Data: captureTimes - Name: k__BackingField Entry: 7 Data: 23|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Single, mscorlib + Data: System.Int32[], mscorlib - Name: Entry: 8 Data: @@ -403,25 +403,31 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: positions + Data: positionCaptures - Name: $v Entry: 7 Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: positions + Data: positionCaptures - Name: k__BackingField Entry: 7 Data: 26|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: UnityEngine.Vector2[], UnityEngine.CoreModule + Data: UnityEngine.Vector2[][], UnityEngine.CoreModule - Name: Entry: 8 Data: - Name: k__BackingField - Entry: 9 - Data: 26 + Entry: 7 + Data: 27|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Object[], mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -436,7 +442,157 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - 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: k__BackingField + Entry: 1 + Data: ownerIndex + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: remoteIndex + - Name: $v + Entry: 7 + Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: remoteIndex + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 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: k__BackingField + Entry: 1 + Data: previousCaptureTime + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 diff --git a/Assets/Test stuff/NetworkManagerSyncTester.cs b/Assets/Test stuff/NetworkManagerSyncTester.cs index 9528154..4c15369 100644 --- a/Assets/Test stuff/NetworkManagerSyncTester.cs +++ b/Assets/Test stuff/NetworkManagerSyncTester.cs @@ -14,66 +14,79 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour [SerializeField] GridMover[] gridMovers2; [SerializeField] Animator debugImageToIndicateSynced; - private float captureTime; - private Vector2[] positions; + 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) { - positions = null; + ownerIndex = -1; + remoteIndex = 0; return; } - if (positions == null) + var ownerTime = networkManager1.SyncedTimeTicks; + + if (ownerTime > previousCaptureTime) { - positions = GetPositions(gridMovers1); - captureTime = networkManager1.SyncedTime; + IncrementIndex(ref ownerIndex); + captureTimes[ownerIndex] = ownerTime; + previousCaptureTime = ownerTime; + positionCaptures[ownerIndex] = GetPositions(gridMovers1); } - var remoteTime = networkManager2.SyncedTime; - if (captureTime > remoteTime) + var remoteTime = networkManager2.SyncedTimeTicks; + + while (captureTimes[remoteIndex] < remoteTime && remoteIndex != ownerIndex) { - return; + DiscardCapture(); } - if (captureTime < remoteTime) + Debug.Log($"ownerTime: {ownerTime}, remoteTime: {remoteTime}, ownerIndex: {ownerIndex} ({captureTimes[ownerIndex]}), remoteIndex: {remoteIndex} ({captureTimes[remoteIndex]})"); + + if (captureTimes[remoteIndex] == remoteTime) { - Debug.Log($"{nameof(NetworkManagerSyncTester)} Skipping check"); - positions = null; - return; + bool equal = IsEqual(remoteIndex); + SetIndicator(equal); + + DiscardCapture(); } - - bool equal = IsEqual(remoteTime); - - SetIndicator(equal); - - positions = null; } - private bool IsEqual(float remoteTime) + private void DiscardCapture() { + positionCaptures[remoteIndex] = null; + IncrementIndex(ref remoteIndex); + } + + private bool IsEqual(int index) + { + var equal = true; + + var positions1 = positionCaptures[index]; var positions2 = GetPositions(gridMovers2); - for (int i = 0; i < positions.Length; i++) + for (int i = 0; i < positions1.Length; i++) { var gridMover1 = gridMovers1[i]; - var gridMover1Position = positions[i]; + var gridMover1Position = positions1[i]; var gridMover2 = gridMovers2[i]; var gridMover2Position = positions2[i]; - var equal = gridMover1Position == gridMover2Position; - - if (!equal) + if (gridMover1Position != gridMover2Position) { - Debug.LogWarning($"{nameof(NetworkManagerSyncTester)} Desync found:\n{gridMover1.name} {gridMover1Position} (at {captureTime}) != {gridMover2.name} {gridMover2Position} (at {remoteTime})"); - networkManager1.Pause(); - networkManager2.Pause(); - return false; + Debug.LogWarning($"{nameof(NetworkManagerSyncTester)} Desync found:\n{gridMover1.name} {gridMover1Position} != {gridMover2.name} {gridMover2Position}"); + //networkManager1.Pause(); + //networkManager2.Pause(); + equal = false; } } - return true; + return equal; } private void SetIndicator(bool value) @@ -84,7 +97,7 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour } } - private Vector2[] GetPositions(GridMover[] gridMovers) + private static Vector2[] GetPositions(GridMover[] gridMovers) { var length = gridMovers.Length; var positions = new Vector2[length]; @@ -96,4 +109,16 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour return positions; } + + private void IncrementIndex(ref int index) + { + if (index >= positionCaptures.Length - 1) + { + index = 0; + } + else + { + index++; + } + } }