From a54d5569d1d795796ad6a1c60d782cf2d8b30d33 Mon Sep 17 00:00:00 2001 From: Jil Franco <89089503+jilfranco-unity@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:20:48 -0400 Subject: [PATCH 01/10] Fix: Negative Collider Warning [MTT-6993] (#854) * changed the scale on diagonal wall colliders to not be negative * changelog update * added PR number to changelog --- .../env_wall1_base_diagonal_1.prefab | 19 +++++++++++++++---- .../env_wall1_base_diagonal_2.prefab | 17 ++++++++++++++--- CHANGELOG.md | 6 ++++++ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_1.prefab b/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_1.prefab index bfe6e7460b..a09767a8d7 100644 --- a/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_1.prefab +++ b/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_1.prefab @@ -28,6 +28,7 @@ Transform: 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: 5915529853195630635} m_Father: {fileID: 0} @@ -52,6 +53,7 @@ MeshRenderer: m_CastShadows: 0 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -106,13 +108,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8750842352150602452} - m_LocalRotation: {x: -0.92387956, y: -0.00000017299969, z: -0.38268343, w: -0.00000007165881} + m_LocalRotation: {x: 0, y: -0.38268343, z: 0, w: 0.92387956} m_LocalPosition: {x: -2.02, y: 1.96, z: -2.01} - m_LocalScale: {x: -1, y: -1, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4437348436208465204} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: -180, y: -45, z: -0.000015258789} + m_LocalEulerAnglesHint: {x: 0, y: -45, z: 0} --- !u!65 &7898993292670171814 BoxCollider: m_ObjectHideFlags: 0 @@ -121,8 +124,16 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8750842352150602452} m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 m_IsTrigger: 0 + m_ProvidesContacts: 0 m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_Size: {x: 1, y: 4, z: 6} m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_2.prefab b/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_2.prefab index 0a2410fdad..055906dc9b 100644 --- a/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_2.prefab +++ b/Assets/Prefabs/Dungeon/Dungeon Pieces/env_wall1_base_diagonal_2.prefab @@ -28,6 +28,7 @@ Transform: 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: 8193510332667705931} m_Father: {fileID: 0} @@ -52,6 +53,7 @@ MeshRenderer: m_CastShadows: 0 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -107,8 +109,9 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4914060456935432399} m_LocalRotation: {x: 0, y: -0.38268343, z: 0, w: 0.92387956} - m_LocalPosition: {x: 2.5663843, y: 1.5000002, z: 2.5656066} + m_LocalPosition: {x: -1.83, y: 2.03, z: -2.11} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2698721903467665021} m_RootOrder: 0 @@ -121,8 +124,16 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4914060456935432399} m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 m_IsTrigger: 0 + m_ProvidesContacts: 0 m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_Size: {x: 1, y: 4, z: 6} - m_Center: {x: -6.5, y: 0.5, z: 0} + m_Center: {x: 0, y: 0, z: 0} diff --git a/CHANGELOG.md b/CHANGELOG.md index 786eb66160..4bbe2854aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com). +## [Unreleased] + +### Fixed +* Fixed colliders on diagonal walls to not have negative scale (#854). + + ## [2.2.0] - 2023-07-06 ### Added From 20b94c619c4ab649a86cda3b511165332f9f222c Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Wed, 16 Aug 2023 13:07:04 -0400 Subject: [PATCH 02/10] feat: 2022.3.7f1 LTS upgrade [MTT-7093] (#855) * updating project to 2022.3.7f1 LTS, while keeping NGO at v1.4.0 * updaing project.metafile to run on 2022.3 * changelog addition * important package updates highlighted * updated nodes in these shaders --------- Co-authored-by: jilfranco-unity --- .yamato/project.metafile | 2 +- ...derPipelineAsset_Renderer_Mobile_Low.asset | 4 +- Assets/VFX/Shaders/SG_Ice.shadergraph | 109 ++++++++++- Assets/VFX/Shaders/SG_Sneaky.shadergraph | 185 ++++++++++++++++-- CHANGELOG.md | 8 +- Packages/manifest.json | 14 +- Packages/packages-lock.json | 38 ++-- ProjectSettings/ProjectSettings.asset | 4 +- ProjectSettings/ProjectVersion.txt | 4 +- 9 files changed, 310 insertions(+), 58 deletions(-) diff --git a/.yamato/project.metafile b/.yamato/project.metafile index ad04dc5e3b..eaa1a89770 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -30,4 +30,4 @@ projects: - name: com.unity.multiplayer.samples.coop path: Packages/com.unity.multiplayer.samples.coop test_editors: - - 2022.3.0 + - 2022.3 diff --git a/Assets/URP/Mobile/0_UniversalRenderPipelineAsset_Renderer_Mobile_Low.asset b/Assets/URP/Mobile/0_UniversalRenderPipelineAsset_Renderer_Mobile_Low.asset index 52159990c8..e60691c2cd 100644 --- a/Assets/URP/Mobile/0_UniversalRenderPipelineAsset_Renderer_Mobile_Low.asset +++ b/Assets/URP/Mobile/0_UniversalRenderPipelineAsset_Renderer_Mobile_Low.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d86c4db0953a9f2a80e2cf948cedbb819ac268843836ecbcb6ed20bd10907ac -size 2274 +oid sha256:cfd1e6e94dd95313459d0ee504b25aa791fbcfbcad12587104e3f43bd9f15e50 +size 2608 diff --git a/Assets/VFX/Shaders/SG_Ice.shadergraph b/Assets/VFX/Shaders/SG_Ice.shadergraph index a5f7f1d056..30c0c1fa04 100644 --- a/Assets/VFX/Shaders/SG_Ice.shadergraph +++ b/Assets/VFX/Shaders/SG_Ice.shadergraph @@ -1447,6 +1447,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1689,6 +1690,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1987,6 +1989,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2044,6 +2047,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -2232,6 +2236,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2253,6 +2258,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -2293,6 +2299,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2332,6 +2339,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -2361,6 +2369,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 2, @@ -2554,6 +2563,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2640,7 +2650,7 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 2, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", "m_ObjectId": "35de7fe31d7a45b1b28c9500fdde57d5" } @@ -2692,6 +2702,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2734,6 +2745,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2841,6 +2853,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2897,6 +2910,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2950,6 +2964,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2998,6 +3013,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3033,6 +3049,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3104,6 +3121,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3234,6 +3252,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3330,6 +3349,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3409,7 +3429,7 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 2, "m_Type": "UnityEditor.ShaderGraph.TransformNode", "m_ObjectId": "554855ec035844fab6c468fcd795fe8e", "m_Group": { @@ -3421,9 +3441,9 @@ "m_Position": { "serializedVersion": "2", "x": -3613.999755859375, - "y": -200.00003051757813, + "y": -200.0, "width": 213.0, - "height": 159.0 + "height": 156.99998474121095 } }, "m_Slots": [ @@ -3437,6 +3457,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3445,7 +3466,8 @@ "from": 2, "to": 0 }, - "m_ConversionType": 0 + "m_ConversionType": 0, + "m_Normalize": true } { @@ -3501,6 +3523,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3569,6 +3592,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3646,13 +3670,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 1, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -3732,6 +3758,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3777,6 +3804,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -3926,6 +3954,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4024,6 +4053,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4077,6 +4107,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4187,6 +4218,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4240,6 +4272,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4278,6 +4311,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4343,6 +4377,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4566,6 +4601,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -4616,6 +4652,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -4736,6 +4773,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -4804,6 +4842,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4867,6 +4906,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4921,6 +4961,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4986,6 +5027,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5067,6 +5109,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5181,13 +5224,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 1, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -5330,6 +5375,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5365,6 +5411,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5557,6 +5604,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5673,6 +5721,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5744,6 +5793,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5887,6 +5937,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5956,6 +6007,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -5994,6 +6046,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6029,6 +6082,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6071,6 +6125,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6117,6 +6172,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -6275,6 +6331,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6446,6 +6503,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6481,6 +6539,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6585,6 +6644,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6623,6 +6683,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6681,6 +6742,7 @@ "m_SGVersion": 1, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", "m_ObjectId": "c16267de219943afa1c97b7ba90eef94", + "m_Datas": [], "m_ActiveSubTarget": { "m_Id": "35de7fe31d7a45b1b28c9500fdde57d5" }, @@ -6693,6 +6755,7 @@ "m_AlphaClip": true, "m_CastShadows": true, "m_ReceiveShadows": true, + "m_SupportsLODCrossFade": false, "m_CustomEditorGUI": "", "m_SupportVFX": false } @@ -6740,6 +6803,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6857,6 +6921,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -6901,6 +6966,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -6970,6 +7036,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7026,6 +7093,7 @@ "synonyms": [], "m_Precision": 1, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 2, "m_CustomColors": { "m_SerializableColors": [] @@ -7066,6 +7134,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7137,6 +7206,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7172,6 +7242,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7213,6 +7284,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7279,13 +7351,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -7497,6 +7571,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7533,6 +7608,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7572,6 +7648,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7669,6 +7746,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -7716,6 +7794,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7796,6 +7875,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 2, "m_CustomColors": { "m_SerializableColors": [] @@ -7840,6 +7920,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7930,6 +8011,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -7968,6 +8050,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8003,6 +8086,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8048,6 +8132,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -8452,6 +8537,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -8586,13 +8672,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -8656,6 +8744,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -8817,6 +8906,7 @@ "m_GeneratePropertyBlock": true, "m_UseCustomSlotLabel": false, "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -8917,6 +9007,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] diff --git a/Assets/VFX/Shaders/SG_Sneaky.shadergraph b/Assets/VFX/Shaders/SG_Sneaky.shadergraph index 04503243c9..533e368f1a 100644 --- a/Assets/VFX/Shaders/SG_Sneaky.shadergraph +++ b/Assets/VFX/Shaders/SG_Sneaky.shadergraph @@ -1,5 +1,5 @@ { - "m_SGVersion": 2, + "m_SGVersion": 3, "m_Type": "UnityEditor.ShaderGraph.GraphData", "m_ObjectId": "dce65955238f46ffb67d00371b3db97b", "m_Properties": [ @@ -32,6 +32,12 @@ } ], "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "3e9b16862bfa479d856e983f44f4796e" + } + ], "m_Nodes": [ { "m_Id": "e868a197148e498d8ccfd00bd36ab945" @@ -904,10 +910,11 @@ "serializedMesh": { "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", "m_Guid": "" - } + }, + "preventRotation": false }, "m_Path": "Shader Graphs", - "m_ConcretePrecision": 0, + "m_GraphPrecision": 0, "m_PreviewMode": 2, "m_OutputNode": { "m_Id": "" @@ -1008,6 +1015,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1267,6 +1275,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1395,6 +1404,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1425,9 +1435,14 @@ "m_GuidSerialized": "5d78dc66-0059-4c1c-b591-8d2993030082" }, "m_Name": "FresnelColor", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Color_13b37c6d27114b5692f570931eeffe81", "m_OverrideReferenceName": "_Fresnel_Color", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -1438,6 +1453,7 @@ "b": 0.0, "a": 0.0 }, + "isMainColor": false, "m_ColorMode": 1 } @@ -1467,6 +1483,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1532,6 +1549,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1570,6 +1588,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1606,6 +1625,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1805,6 +1825,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -1889,6 +1910,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2066,6 +2088,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2073,17 +2096,61 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 1, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", "m_ObjectId": "3af2366e9595474fa466116db8f60424", + "m_Datas": [], "m_ActiveSubTarget": { "m_Id": "6e1b47ec012e4023afc444860b7370b3" }, + "m_AllowMaterialOverride": false, "m_SurfaceType": 1, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, "m_AlphaMode": 0, - "m_TwoSided": false, + "m_RenderFace": 2, "m_AlphaClip": false, - "m_CustomEditorGUI": "" + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_SupportsLODCrossFade": false, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "3e9b16862bfa479d856e983f44f4796e", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "aad637ae3cc24c87bafa72c12eaa4bb5" + }, + { + "m_Id": "5378073f3e4d4191812bd2280a2d8e15" + }, + { + "m_Id": "841e7ddbeeeb455e9d8fd6c07e035474" + }, + { + "m_Id": "13b37c6d27114b5692f570931eeffe81" + }, + { + "m_Id": "4f50828942c447d4b2161cb02eabd447" + }, + { + "m_Id": "fd5278c91b214e2f94e8a54cabaf8a09" + }, + { + "m_Id": "42444d1ee1a4448f910db5331dfc6e5a" + }, + { + "m_Id": "fb5cb898ca9c41a8b92ef36ff0195a6b" + }, + { + "m_Id": "4471b137f98845cf9a89c95000ffef59" + } + ] } { @@ -2135,9 +2202,14 @@ "m_GuidSerialized": "ce448279-3b9c-48be-8ced-259c770870b8" }, "m_Name": "NoiseIntensity", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "", "m_OverrideReferenceName": "_Noise_Intensity", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -2158,9 +2230,14 @@ "m_GuidSerialized": "a22f3bd3-1b4b-4920-b310-4f90c1eec69a" }, "m_Name": "Noise Tile/Speed", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "", "m_OverrideReferenceName": "Vector4_fb5cb898ca9c41a8b92ef36ff0195a6b_1", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -2354,6 +2431,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2366,7 +2444,9 @@ "m_PropertyIds": [ 1564051286, 744847666 - ] + ], + "m_Dropdowns": [], + "m_DropdownSelectedEntries": [] } { @@ -2401,6 +2481,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2461,11 +2542,13 @@ "synonyms": [], "m_Precision": 1, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 2, "m_CustomColors": { "m_SerializableColors": [] }, - "m_Space": 2 + "m_Space": 2, + "m_PositionSource": 0 } { @@ -2515,12 +2598,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 1, - "m_NormalMapSpace": 0 + "m_NormalMapSpace": 0, + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -2531,9 +2617,14 @@ "m_GuidSerialized": "7528e89a-1644-43b0-a333-c67333ab73b9" }, "m_Name": "T_NormalMap_2", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Texture2D_4f50828942c447d4b2161cb02eabd447", "m_OverrideReferenceName": "_T_Normal_Map_2", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -2542,6 +2633,8 @@ "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"7653d661bb658e64aae075bcbd3bb8ec\",\"type\":3}}", "m_Guid": "" }, + "isMainTexture": false, + "useTilingAndOffset": false, "m_Modifiable": true, "m_DefaultType": 3 } @@ -2572,6 +2665,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2617,9 +2711,14 @@ "m_GuidSerialized": "5505d199-31f3-4e9c-9742-fd46c6f08be0" }, "m_Name": "Distortion", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Vector1_5378073f3e4d4191812bd2280a2d8e15", "m_OverrideReferenceName": "_Distortion", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -2699,6 +2798,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2741,6 +2841,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2912,6 +3013,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -2963,6 +3065,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3073,6 +3176,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3199,6 +3303,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3236,7 +3341,7 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 2, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", "m_ObjectId": "6e1b47ec012e4023afc444860b7370b3" } @@ -3273,6 +3378,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3513,6 +3619,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3582,9 +3689,14 @@ "m_GuidSerialized": "701437aa-2e56-4d8d-a336-a54ffbd9fa5a" }, "m_Name": "Sneak", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "", "m_OverrideReferenceName": "_Sneak", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -3740,6 +3852,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3930,6 +4043,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3962,6 +4076,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -3997,6 +4112,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4145,9 +4261,14 @@ "m_GuidSerialized": "c9d28f9e-58ec-41cc-8eaf-8bdf8fd9e3b1" }, "m_Name": "FresnelPower", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Vector1_aad637ae3cc24c87bafa72c12eaa4bb5", "m_OverrideReferenceName": "_Fresnel_Power", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -4336,6 +4457,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4429,12 +4551,15 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] }, "m_TextureType": 0, - "m_NormalMapSpace": 0 + "m_NormalMapSpace": 0, + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 } { @@ -4478,6 +4603,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4609,6 +4735,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4668,6 +4795,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 2, "m_CustomColors": { "m_SerializableColors": [] @@ -4723,7 +4851,7 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 2, "m_Type": "UnityEditor.ShaderGraph.TransformNode", "m_ObjectId": "ca93e722fd7f46b89522ae5a66e8bd09", "m_Group": { @@ -4751,6 +4879,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4759,7 +4888,8 @@ "from": 2, "to": 0 }, - "m_ConversionType": 0 + "m_ConversionType": 0, + "m_Normalize": true } { @@ -4830,6 +4960,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4880,6 +5011,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4945,6 +5077,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -4988,6 +5121,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5032,6 +5166,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5148,6 +5283,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5192,6 +5328,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5295,6 +5432,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5366,6 +5504,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5418,6 +5557,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5513,6 +5653,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5563,6 +5704,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": true, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5643,9 +5785,14 @@ "m_GuidSerialized": "5150b093-1552-49d6-aa68-10a341e37976" }, "m_Name": "Normal Tile/Speed", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Vector4_fb5cb898ca9c41a8b92ef36ff0195a6b", "m_OverrideReferenceName": "", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -5666,9 +5813,14 @@ "m_GuidSerialized": "d5e80aff-eecc-4c96-a1bb-bdd4ce90a20f" }, "m_Name": "Noise Fresnel", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "", "m_OverrideReferenceName": "_Noise_Fresnel", "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -5677,6 +5829,8 @@ "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"a225a619c91968049ba2bdbc44c812fb\",\"type\":3}}", "m_Guid": "" }, + "isMainTexture": false, + "useTilingAndOffset": false, "m_Modifiable": true, "m_DefaultType": 0 } @@ -5713,6 +5867,7 @@ "synonyms": [], "m_Precision": 0, "m_PreviewExpanded": false, + "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { "m_SerializableColors": [] @@ -5725,7 +5880,9 @@ "m_PropertyIds": [ 1564051286, 744847666 - ] + ], + "m_Dropdowns": [], + "m_DropdownSelectedEntries": [] } { diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bbe2854aa..469ee6c4a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com). -## [Unreleased] +## [Unreleased] - yyyy-mm-dd + +### Changed +* Upgraded editor version to 2022.3.7f1 (#855) + * Upgraded Authentication Service package to v2.7.1 + * Upgraded Wire Service package to v1.2.0 ### Fixed * Fixed colliders on diagonal walls to not have negative scale (#854). - ## [2.2.0] - 2023-07-06 ### Added diff --git a/Packages/manifest.json b/Packages/manifest.json index f116dcf075..f2102a4c11 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,10 +1,10 @@ { "dependencies": { "com.unity.2d.sprite": "1.0.0", - "com.unity.ai.navigation": "1.1.3", + "com.unity.ai.navigation": "1.1.4", "com.unity.cinemachine": "2.9.5", - "com.unity.collab-proxy": "2.0.4", - "com.unity.ide.rider": "3.0.21", + "com.unity.collab-proxy": "2.0.5", + "com.unity.ide.rider": "3.0.24", "com.unity.ide.visualstudio": "2.0.18", "com.unity.ide.vscode": "1.2.5", "com.unity.learn.iet-framework": "3.1.3", @@ -13,14 +13,14 @@ "com.unity.netcode.gameobjects": "1.4.0", "com.unity.performance.profile-analyzer": "1.2.2", "com.unity.postprocessing": "3.2.2", - "com.unity.render-pipelines.universal": "14.0.7", - "com.unity.services.authentication": "2.5.0", + "com.unity.render-pipelines.universal": "14.0.8", + "com.unity.services.authentication": "2.7.1", "com.unity.services.lobby": "1.1.0-pre.3", "com.unity.services.relay": "1.0.5", - "com.unity.services.wire": "1.1.5", + "com.unity.services.wire": "1.2.0", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", - "com.unity.timeline": "1.7.4", + "com.unity.timeline": "1.7.5", "com.unity.toolchain.macos-x86_64-linux-x86_64": "2.0.4", "com.unity.transport": "2.0.2", "com.unity.ugui": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index a992a523cb..fa95b1dc95 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -7,7 +7,7 @@ "dependencies": {} }, "com.unity.ai.navigation": { - "version": "1.1.3", + "version": "1.1.4", "depth": 0, "source": "registry", "dependencies": { @@ -16,7 +16,7 @@ "url": "https://packages.unity.com" }, "com.unity.burst": { - "version": "1.8.4", + "version": "1.8.7", "depth": 1, "source": "registry", "dependencies": { @@ -34,7 +34,7 @@ "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "2.0.4", + "version": "2.0.5", "depth": 0, "source": "registry", "dependencies": {}, @@ -66,7 +66,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.21", + "version": "3.0.24", "depth": 0, "source": "registry", "dependencies": { @@ -190,7 +190,7 @@ "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "14.0.7", + "version": "14.0.8", "depth": 1, "source": "builtin", "dependencies": { @@ -201,14 +201,14 @@ } }, "com.unity.render-pipelines.universal": { - "version": "14.0.7", + "version": "14.0.8", "depth": 0, "source": "builtin", "dependencies": { "com.unity.mathematics": "1.2.1", "com.unity.burst": "1.8.4", - "com.unity.render-pipelines.core": "14.0.7", - "com.unity.shadergraph": "14.0.7" + "com.unity.render-pipelines.core": "14.0.8", + "com.unity.shadergraph": "14.0.8" } }, "com.unity.searcher": { @@ -219,19 +219,19 @@ "url": "https://packages.unity.com" }, "com.unity.services.authentication": { - "version": "2.5.0", + "version": "2.7.1", "depth": 0, "source": "registry", "dependencies": { "com.unity.nuget.newtonsoft-json": "3.2.1", - "com.unity.services.core": "1.9.0", + "com.unity.services.core": "1.10.1", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.ugui": "1.0.0" }, "url": "https://packages.unity.com" }, "com.unity.services.core": { - "version": "1.9.0", + "version": "1.10.1", "depth": 1, "source": "registry", "dependencies": { @@ -259,7 +259,7 @@ "url": "https://packages.unity.com" }, "com.unity.services.qos": { - "version": "1.2.0", + "version": "1.2.1", "depth": 1, "source": "registry", "dependencies": { @@ -290,13 +290,13 @@ "url": "https://packages.unity.com" }, "com.unity.services.wire": { - "version": "1.1.5", + "version": "1.2.0", "depth": 0, "source": "registry", "dependencies": { - "com.unity.services.core": "1.8.1", - "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.services.authentication": "2.4.0" + "com.unity.services.core": "1.10.1", + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.services.authentication": "2.6.1" }, "url": "https://packages.unity.com" }, @@ -308,11 +308,11 @@ "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "14.0.7", + "version": "14.0.8", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "14.0.7", + "com.unity.render-pipelines.core": "14.0.8", "com.unity.searcher": "4.9.2" } }, @@ -353,7 +353,7 @@ "url": "https://packages.unity.com" }, "com.unity.timeline": { - "version": "1.7.4", + "version": "1.7.5", "depth": 0, "source": "registry", "dependencies": { diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index ca6ce243ce..83c7682180 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:121bd7550239de5f33d6c5a062be0d5448248fd6d14ac250a9e9863776fd3e0f -size 26762 +oid sha256:c3cabe86404e4b93444944c7a3fd899524121a1061d652bbf5ff2f41b81a4d32 +size 26959 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 56ddb83a41..78a778891e 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2022.3.0f1 -m_EditorVersionWithRevision: 2022.3.0f1 (fb119bb0b476) +m_EditorVersion: 2022.3.7f1 +m_EditorVersionWithRevision: 2022.3.7f1 (b16b3b16c7a0) From c6617689e2e0729d017bd8a8276632dfe2926d6e Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Wed, 30 Aug 2023 17:22:00 -0400 Subject: [PATCH 03/10] feat: upgrade project to NGO v1.6.0 [MTT-6875] (#865) * upgrade project to NGO v1.6.0 * creating version define for NGO versions of range 1.5.2 to 1.6.0 & excluding single failing test * code standards pass * changelog addition * adding more context * more context --- Assets/Tests/Runtime/ConnectionManagementTests.cs | 7 +++++-- .../Tests/Runtime/Unity.BossRoom.Tests.Runtime.asmdef | 10 ++++++++-- CHANGELOG.md | 2 ++ Packages/manifest.json | 2 +- Packages/packages-lock.json | 4 ++-- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Assets/Tests/Runtime/ConnectionManagementTests.cs b/Assets/Tests/Runtime/ConnectionManagementTests.cs index a602174285..91d05649ba 100644 --- a/Assets/Tests/Runtime/ConnectionManagementTests.cs +++ b/Assets/Tests/Runtime/ConnectionManagementTests.cs @@ -67,7 +67,6 @@ public override void LoadScene(string sceneName, bool useNetworkSceneManager, Lo ConnectionManager[] m_ClientConnectionManagers; ConnectionManager m_ServerConnectionManager; - protected override bool CanStartServerAndClients() { return false; @@ -154,6 +153,7 @@ protected override IEnumerator OnTearDown() { GameObject.DestroyImmediate(sceneGameObject); } + yield return base.OnTearDown(); } @@ -285,6 +285,7 @@ public IEnumerator AttemptingToConnectWithSamePlayerId_ClientsDisconnectedWithRe // The first client should be able to connect Assert.IsTrue(m_ClientNetworkManagers[0].IsConnectedClient, "The first client is not connected."); + // Every other client should get their connection denied for (var i = 1; i < NumberOfClients; i++) { @@ -356,6 +357,7 @@ public IEnumerator UnexpectedClientDisconnect_ClientReconnectingSuccessfully() subscriptions.Dispose(); } +#if !NETCODEFORGAMEOBJECTS_1_5_2_OR_1_6_0 [UnityTest] public IEnumerator UnexpectedServerShutdown_ClientsFailToReconnect() { @@ -435,6 +437,7 @@ public IEnumerator UnexpectedServerShutdown_ClientsFailToReconnect() Assert.AreEqual(NumberOfClients, nbGenericDisconnectMsgReceived, "Not all clients received a GenericDisconnect message."); subscriptions.Dispose(); } +#endif [UnityTest] public IEnumerator ClientAndHostChangingRolesBetweenSessions_Success() @@ -508,6 +511,7 @@ public IEnumerator ClientCancellingWhileConnectingToNonExistingServer_NoConnecti { m_ClientConnectionManagers[i].StartClientIp($"client{i}", "127.0.0.1", 9998); } + m_ClientConnectionManagers[0].RequestShutdown(); for (var i = 1; i < NumberOfClients; i++) @@ -523,6 +527,5 @@ public IEnumerator ClientCancellingWhileConnectingToNonExistingServer_NoConnecti Assert.IsFalse(m_ClientNetworkManagers[i].IsConnectedClient, $"Client{i} is connected while no server is running."); } } - } } diff --git a/Assets/Tests/Runtime/Unity.BossRoom.Tests.Runtime.asmdef b/Assets/Tests/Runtime/Unity.BossRoom.Tests.Runtime.asmdef index 1fb1fad2fb..4a416b5efb 100644 --- a/Assets/Tests/Runtime/Unity.BossRoom.Tests.Runtime.asmdef +++ b/Assets/Tests/Runtime/Unity.BossRoom.Tests.Runtime.asmdef @@ -28,6 +28,12 @@ "defineConstraints": [ "UNITY_INCLUDE_TESTS" ], - "versionDefines": [], + "versionDefines": [ + { + "name": "com.unity.netcode.gameobjects", + "expression": "[1.5.2,1.6.0]", + "define": "NETCODEFORGAMEOBJECTS_1_5_2_OR_1_6_0" + } + ], "noEngineReferences": false -} +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 469ee6c4a8..5dbf3b3ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Additional documentation and release notes are available at [Multiplayer Documen * Upgraded editor version to 2022.3.7f1 (#855) * Upgraded Authentication Service package to v2.7.1 * Upgraded Wire Service package to v1.2.0 +* Upgraded Boss Room to Netcode for GameObjects v1.6.0 (#865) + * A package Version Define has been created for Netcode for GameObjects v.1.5.2 - v1.6.0. Recent refactorings to NetworkManager's shutdown have prevented the ability to invoke CustomMessages when OnClientDisconnected callbacks are invoked during a shutdown as host. This regression has caused one of our runtime tests, namely Unity.BossRoom.Tests.Runtime.ConnectionManagementTests.UnexpectedServerShutdown_ClientsFailToReconnect, to fail and it does not impact gameplay. This is a known issue and will be addressed in a future NGO version. ### Fixed * Fixed colliders on diagonal walls to not have negative scale (#854). diff --git a/Packages/manifest.json b/Packages/manifest.json index f2102a4c11..abb68c8f43 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -10,7 +10,7 @@ "com.unity.learn.iet-framework": "3.1.3", "com.unity.memoryprofiler": "1.0.0", "com.unity.multiplayer.tools": "2.0.0-pre.3", - "com.unity.netcode.gameobjects": "1.4.0", + "com.unity.netcode.gameobjects": "1.6.0", "com.unity.performance.profile-analyzer": "1.2.2", "com.unity.postprocessing": "3.2.2", "com.unity.render-pipelines.universal": "14.0.8", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index fa95b1dc95..869a8b6df5 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -143,12 +143,12 @@ "url": "https://packages.unity.com" }, "com.unity.netcode.gameobjects": { - "version": "1.4.0", + "version": "1.6.0", "depth": 0, "source": "registry", "dependencies": { "com.unity.nuget.mono-cecil": "1.10.1", - "com.unity.transport": "1.3.3" + "com.unity.transport": "1.3.4" }, "url": "https://packages.unity.com" }, From 774b3f8ad4eb2d324dfb117ce2e0cb9640231671 Mon Sep 17 00:00:00 2001 From: LPLafontaineB Date: Thu, 31 Aug 2023 10:57:15 -0400 Subject: [PATCH 04/10] feat: upgrade to lobby 1.1.0 [MTT-7092] [MTT-5665] [MTT-7101] [MTT-5708] (#860) * updating to lobby 1.1.0 * locking lobby at creation to prevent other players from joining before it is ready * removing explicit reference to wire in package manifest * removing unnecessary periodic lobby updates * removing old exception catch that is no longer necessary and adding new temporary catch for edge case exception --- .../ConnectionManagement/ConnectionMethod.cs | 18 +-- .../ConnectionState/HostingState.cs | 2 +- .../ConnectionState/StartingHostState.cs | 1 - .../Lobbies/JoinedLobbyContentHeartbeat.cs | 75 ----------- .../JoinedLobbyContentHeartbeat.cs.meta | 11 -- .../Lobbies/LobbyAPIInterface.cs | 1 + .../Lobbies/LobbyServiceFacade.cs | 119 +++++++++--------- .../Unity.BossRoom.UnityServices.asmdef | 1 + CHANGELOG.md | 7 +- Packages/manifest.json | 3 +- Packages/packages-lock.json | 8 +- 11 files changed, 81 insertions(+), 165 deletions(-) delete mode 100644 Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs delete mode 100644 Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs.meta diff --git a/Assets/Scripts/ConnectionManagement/ConnectionMethod.cs b/Assets/Scripts/ConnectionManagement/ConnectionMethod.cs index 9e56ecf0dd..3a0b6087d0 100644 --- a/Assets/Scripts/ConnectionManagement/ConnectionMethod.cs +++ b/Assets/Scripts/ConnectionManagement/ConnectionMethod.cs @@ -66,11 +66,11 @@ protected void SetConnectionPayload(string playerId, string playerName) m_ConnectionManager.NetworkManager.NetworkConfig.ConnectionData = payloadBytes; } - /// Using authentication, this makes sure your session is associated with your account and not your device. This means you could reconnect - /// from a different device for example. A playerId is also a bit more permanent than player prefs. In a browser for example, + /// Using authentication, this makes sure your session is associated with your account and not your device. This means you could reconnect + /// from a different device for example. A playerId is also a bit more permanent than player prefs. In a browser for example, /// player prefs can be cleared as easily as cookies. - /// The forked flow here is for debug purposes and to make UGS optional in Boss Room. This way you can study the sample without - /// setting up a UGS account. It's recommended to investigate your own initialization and IsSigned flows to see if you need + /// The forked flow here is for debug purposes and to make UGS optional in Boss Room. This way you can study the sample without + /// setting up a UGS account. It's recommended to investigate your own initialization and IsSigned flows to see if you need /// those checks on your own and react accordingly. We offer here the option for offline access for debug purposes, but in your own game you /// might want to show an error popup and ask your player to connect to the internet. protected string GetPlayerId() @@ -156,7 +156,7 @@ public override async Task SetupClientConnectionAsync() $"host: {joinedAllocation.HostConnectionData[0]} {joinedAllocation.HostConnectionData[1]}, " + $"client: {joinedAllocation.AllocationId}"); - await m_LobbyServiceFacade.UpdatePlayerRelayInfoAsync(joinedAllocation.AllocationId.ToString(), m_LocalLobby.RelayJoinCode); + await m_LobbyServiceFacade.UpdatePlayerDataAsync(joinedAllocation.AllocationId.ToString(), m_LocalLobby.RelayJoinCode); // Configure UTP with allocation var utp = (UnityTransport)m_ConnectionManager.NetworkManager.NetworkConfig.NetworkTransport; @@ -197,13 +197,15 @@ public override async Task SetupHostConnectionAsync() m_LocalLobby.RelayJoinCode = joinCode; - //next line enable lobby and relay services integration - await m_LobbyServiceFacade.UpdateLobbyDataAsync(m_LocalLobby.GetDataForUnityServices()); - await m_LobbyServiceFacade.UpdatePlayerRelayInfoAsync(hostAllocation.AllocationIdBytes.ToString(), joinCode); + // next line enables lobby and relay services integration + await m_LobbyServiceFacade.UpdateLobbyDataAndUnlockAsync(); + await m_LobbyServiceFacade.UpdatePlayerDataAsync(hostAllocation.AllocationIdBytes.ToString(), joinCode); // Setup UTP with relay connection info var utp = (UnityTransport)m_ConnectionManager.NetworkManager.NetworkConfig.NetworkTransport; utp.SetRelayServerData(new RelayServerData(hostAllocation, k_DtlsConnType)); // This is with DTLS enabled for a secure connection + + Debug.Log($"Created relay allocation with join code {m_LocalLobby.RelayJoinCode}"); } } } diff --git a/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs b/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs index 60c5753775..45c5b20a6d 100644 --- a/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs +++ b/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs @@ -129,7 +129,7 @@ public override void ApprovalCheck(NetworkManager.ConnectionApprovalRequest requ response.Reason = JsonUtility.ToJson(gameReturnStatus); if (m_LobbyServiceFacade.CurrentUnityLobby != null) { - m_LobbyServiceFacade.RemovePlayerFromLobbyAsync(connectionPayload.playerId, m_LobbyServiceFacade.CurrentUnityLobby.Id); + m_LobbyServiceFacade.RemovePlayerFromLobbyAsync(connectionPayload.playerId); } } diff --git a/Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs b/Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs index a752cda77a..9008ade098 100644 --- a/Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs +++ b/Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs @@ -68,7 +68,6 @@ async void StartHost() try { await m_ConnectionMethod.SetupHostConnectionAsync(); - Debug.Log($"Created relay allocation with join code {m_LocalLobby.RelayJoinCode}"); // NGO's StartHost launches everything if (!m_ConnectionManager.NetworkManager.StartHost()) diff --git a/Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs b/Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs deleted file mode 100644 index f63e28312b..0000000000 --- a/Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Unity.BossRoom.Infrastructure; -using VContainer; - -namespace Unity.BossRoom.UnityServices.Lobbies -{ - /// - /// Keep updated on changes to a joined lobby, at a speed compliant with Lobby's rate limiting. - /// - public class JoinedLobbyContentHeartbeat - { - [Inject] LocalLobby m_LocalLobby; - [Inject] LocalLobbyUser m_LocalUser; - [Inject] UpdateRunner m_UpdateRunner; - [Inject] LobbyServiceFacade m_LobbyServiceFacade; - - int m_AwaitingQueryCount = 0; - bool m_ShouldPushData = false; - - public void BeginTracking() - { - m_UpdateRunner.Subscribe(OnUpdate, 1.5f); - m_LocalLobby.changed += OnLocalLobbyChanged; - m_ShouldPushData = true; // Ensure the initial presence of a new player is pushed to the lobby; otherwise, when a non-host joins, the LocalLobby never receives their data until they push something new. - } - - public void EndTracking() - { - m_ShouldPushData = false; - m_UpdateRunner.Unsubscribe(OnUpdate); - m_LocalLobby.changed -= OnLocalLobbyChanged; - } - - void OnLocalLobbyChanged(LocalLobby lobby) - { - if (string.IsNullOrEmpty(lobby.LobbyID)) // When the player leaves, their LocalLobby is cleared out but maintained. - { - EndTracking(); - } - - m_ShouldPushData = true; - } - - /// - /// If there have been any data changes since the last update, push them to Lobby. - /// (Unless we're already awaiting a query, in which case continue waiting.) - /// - async void OnUpdate(float dt) - { - if (m_AwaitingQueryCount > 0) - { - return; - } - - if (m_LocalUser.IsHost) - { - m_LobbyServiceFacade.DoLobbyHeartbeat(dt); - } - - if (m_ShouldPushData) - { - m_ShouldPushData = false; - - if (m_LocalUser.IsHost) - { - m_AwaitingQueryCount++; // todo this should disapear once we use await correctly. This causes issues at the moment if OnSuccess isn't called properly - await m_LobbyServiceFacade.UpdateLobbyDataAsync(m_LocalLobby.GetDataForUnityServices()); - m_AwaitingQueryCount--; - } - m_AwaitingQueryCount++; - await m_LobbyServiceFacade.UpdatePlayerDataAsync(m_LocalUser.GetDataForUnityServices()); - m_AwaitingQueryCount--; - } - } - } -} diff --git a/Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs.meta b/Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs.meta deleted file mode 100644 index a971674850..0000000000 --- a/Assets/Scripts/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c198580a376d8264e822d2ef5df1a656 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/UnityServices/Lobbies/LobbyAPIInterface.cs b/Assets/Scripts/UnityServices/Lobbies/LobbyAPIInterface.cs index 426e9ec470..fc3e31808f 100644 --- a/Assets/Scripts/UnityServices/Lobbies/LobbyAPIInterface.cs +++ b/Assets/Scripts/UnityServices/Lobbies/LobbyAPIInterface.cs @@ -42,6 +42,7 @@ public async Task CreateLobby(string requesterUasId, string lobbyName, in CreateLobbyOptions createOptions = new CreateLobbyOptions { IsPrivate = isPrivate, + IsLocked = true, // locking the lobby at creation to prevent other players from joining before it is ready Player = new Player(id: requesterUasId, data: hostUserData), Data = lobbyData }; diff --git a/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs b/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs index 1692c4ade6..4a34c7ddc8 100644 --- a/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs +++ b/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs @@ -5,6 +5,7 @@ using Unity.Services.Authentication; using Unity.Services.Lobbies; using Unity.Services.Lobbies.Models; +using Unity.Services.Wire.Internal; using UnityEngine; using VContainer; using VContainer.Unity; @@ -28,7 +29,6 @@ public class LobbyServiceFacade : IDisposable, IStartable LifetimeScope m_ServiceScope; LobbyAPIInterface m_LobbyApiInterface; - JoinedLobbyContentHeartbeat m_JoinedLobbyContentHeartbeat; RateLimitCooldown m_RateLimitQuery; RateLimitCooldown m_RateLimitJoin; @@ -47,12 +47,10 @@ public void Start() { m_ServiceScope = m_ParentScope.CreateChild(builder => { - builder.Register(Lifetime.Singleton); builder.Register(Lifetime.Singleton); }); m_LobbyApiInterface = m_ServiceScope.Container.Resolve(); - m_JoinedLobbyContentHeartbeat = m_ServiceScope.Container.Resolve(); //See https://docs.unity.com/lobby/rate-limits.html m_RateLimitQuery = new RateLimitCooldown(1f); @@ -76,18 +74,42 @@ public void SetRemoteLobby(Lobby lobby) m_LocalLobby.ApplyRemoteData(lobby); } + /// + /// Initiates tracking of joined lobby's events. The host also starts sending heartbeat pings here. + /// public void BeginTracking() { if (!m_IsTracking) { m_IsTracking = true; SubscribeToJoinedLobbyAsync(); - m_JoinedLobbyContentHeartbeat.BeginTracking(); + + // Only the host sends heartbeat pings to the service to keep the lobby alive + if (m_LocalUser.IsHost) + { + m_HeartbeatTime = 0; + m_UpdateRunner.Subscribe(DoLobbyHeartbeat, 1.5f); + } } } + /// + /// Ends tracking of joined lobby's events and leaves or deletes the lobby. The host also stops sending heartbeat pings here. + /// public void EndTracking() { + if (m_IsTracking) + { + m_IsTracking = false; + UnsubscribeToJoinedLobbyAsync(); + + // Only the host sends heartbeat pings to the service to keep the lobby alive + if (m_LocalUser.IsHost) + { + m_UpdateRunner.Unsubscribe(DoLobbyHeartbeat); + } + } + if (CurrentUnityLobby != null) { if (m_LocalUser.IsHost) @@ -99,12 +121,6 @@ public void EndTracking() LeaveLobbyAsync(); } } - - if (m_IsTracking) - { - m_IsTracking = false; - UnsubscribeToJoinedLobbyAsync(); - } } /// @@ -224,6 +240,7 @@ void OnLobbyChanges(ILobbyChanges changes) { Debug.Log("Lobby deleted"); ResetLobby(); + EndTracking(); } else { @@ -253,6 +270,7 @@ void OnKickedFromLobby() { Debug.Log("Kicked from Lobby"); ResetLobby(); + EndTracking(); } void OnLobbyEventConnectionStateChanged(LobbyEventConnectionState lobbyEventConnectionState) @@ -270,28 +288,27 @@ async void SubscribeToJoinedLobbyAsync() // The LobbyEventCallbacks object created here will now be managed by the Lobby SDK. The callbacks will be // unsubscribed from when we call UnsubscribeAsync on the ILobbyEvents object we receive and store here. m_LobbyEvents = await m_LobbyApiInterface.SubscribeToLobby(m_LocalLobby.LobbyID, lobbyEventCallbacks); - m_JoinedLobbyContentHeartbeat.BeginTracking(); } async void UnsubscribeToJoinedLobbyAsync() { if (m_LobbyEvents != null && m_LobbyEventConnectionState != LobbyEventConnectionState.Unsubscribed) { +#if UNITY_EDITOR try { await m_LobbyEvents.UnsubscribeAsync(); } - catch (ObjectDisposedException e) + catch (WebSocketException e) { // This exception occurs in the editor when exiting play mode without first leaving the lobby. - // This is because Wire disposes of subscriptions internally when exiting play mode in the editor. - Debug.Log("Subscription is already disposed of, cannot unsubscribe."); + // This is because Wire closes the websocket internally when exiting playmode in the editor. Debug.Log(e.Message); } - +#else + await m_LobbyEvents.UnsubscribeAsync(); +#endif } - m_HeartbeatTime = 0; - m_JoinedLobbyContentHeartbeat.EndTracking(); } /// @@ -344,13 +361,12 @@ public async Task ReconnectToLobbyAsync() /// /// Attempt to leave a lobby /// - public async void LeaveLobbyAsync() + async void LeaveLobbyAsync() { string uasId = AuthenticationService.Instance.PlayerId; try { await m_LobbyApiInterface.RemovePlayerFromLobby(uasId, m_LocalLobby.LobbyID); - ResetLobby(); } catch (LobbyServiceException e) { @@ -360,16 +376,20 @@ public async void LeaveLobbyAsync() PublishError(e); } } + finally + { + ResetLobby(); + } } - public async void RemovePlayerFromLobbyAsync(string uasId, string lobbyId) + public async void RemovePlayerFromLobbyAsync(string uasId) { if (m_LocalUser.IsHost) { try { - await m_LobbyApiInterface.RemovePlayerFromLobby(uasId, lobbyId); + await m_LobbyApiInterface.RemovePlayerFromLobby(uasId, m_LocalLobby.LobbyID); } catch (LobbyServiceException e) { @@ -382,19 +402,22 @@ public async void RemovePlayerFromLobbyAsync(string uasId, string lobbyId) } } - public async void DeleteLobbyAsync() + async void DeleteLobbyAsync() { if (m_LocalUser.IsHost) { try { await m_LobbyApiInterface.DeleteLobby(m_LocalLobby.LobbyID); - ResetLobby(); } catch (LobbyServiceException e) { PublishError(e); } + finally + { + ResetLobby(); + } } else { @@ -403,9 +426,11 @@ public async void DeleteLobbyAsync() } /// - /// Attempt to push a set of key-value pairs associated with the local player which will overwrite any existing data for these keys. + /// Attempt to push a set of key-value pairs associated with the local player which will overwrite any existing + /// data for these keys. Lobby can be provided info about Relay (or any other remote allocation) so it can add + /// automatic disconnect handling. /// - public async Task UpdatePlayerDataAsync(Dictionary data) + public async Task UpdatePlayerDataAsync(string allocationId, string connectionInfo) { if (!m_RateLimitQuery.CanCall) { @@ -414,7 +439,7 @@ public async Task UpdatePlayerDataAsync(Dictionary dat try { - var result = await m_LobbyApiInterface.UpdatePlayer(CurrentUnityLobby.Id, AuthenticationService.Instance.PlayerId, data, null, null); + var result = await m_LobbyApiInterface.UpdatePlayer(CurrentUnityLobby.Id, AuthenticationService.Instance.PlayerId, m_LocalUser.GetDataForUnityServices(), allocationId, connectionInfo); if (result != null) { @@ -435,47 +460,20 @@ public async Task UpdatePlayerDataAsync(Dictionary dat } /// - /// Lobby can be provided info about Relay (or any other remote allocation) so it can add automatic disconnect handling. + /// Attempt to update the set of key-value pairs associated with a given lobby and unlocks it so clients can see it. /// - public async Task UpdatePlayerRelayInfoAsync(string allocationId, string connectionInfo) + public async Task UpdateLobbyDataAndUnlockAsync() { if (!m_RateLimitQuery.CanCall) { return; } - try - { - await m_LobbyApiInterface.UpdatePlayer(CurrentUnityLobby.Id, AuthenticationService.Instance.PlayerId, new Dictionary(), allocationId, connectionInfo); - } - catch (LobbyServiceException e) - { - if (e.Reason == LobbyExceptionReason.RateLimited) - { - m_RateLimitQuery.PutOnCooldown(); - } - else - { - PublishError(e); - } - - //todo - retry logic? SDK is supposed to handle this eventually - } - } - - /// - /// Attempt to update a set of key-value pairs associated with a given lobby. - /// - public async Task UpdateLobbyDataAsync(Dictionary data) - { - if (!m_RateLimitQuery.CanCall) - { - return; - } + var localData = m_LocalLobby.GetDataForUnityServices(); var dataCurr = CurrentUnityLobby.Data ?? new Dictionary(); - foreach (var dataNew in data) + foreach (var dataNew in localData) { if (dataCurr.ContainsKey(dataNew.Key)) { @@ -487,12 +485,9 @@ public async Task UpdateLobbyDataAsync(Dictionary data) } } - //we would want to lock lobbies from appearing in queries if we're in relay mode and the relay isn't fully set up yet - var shouldLock = string.IsNullOrEmpty(m_LocalLobby.RelayJoinCode); - try { - var result = await m_LobbyApiInterface.UpdateLobby(CurrentUnityLobby.Id, dataCurr, shouldLock); + var result = await m_LobbyApiInterface.UpdateLobby(CurrentUnityLobby.Id, dataCurr, shouldLock: false); if (result != null) { @@ -515,7 +510,7 @@ public async Task UpdateLobbyDataAsync(Dictionary data) /// /// Lobby requires a periodic ping to detect rooms that are still active, in order to mitigate "zombie" lobbies. /// - public void DoLobbyHeartbeat(float dt) + void DoLobbyHeartbeat(float dt) { m_HeartbeatTime += dt; if (m_HeartbeatTime > k_HeartbeatPeriod) diff --git a/Assets/Scripts/UnityServices/Unity.BossRoom.UnityServices.asmdef b/Assets/Scripts/UnityServices/Unity.BossRoom.UnityServices.asmdef index 2c02b66be7..b5c8c57535 100644 --- a/Assets/Scripts/UnityServices/Unity.BossRoom.UnityServices.asmdef +++ b/Assets/Scripts/UnityServices/Unity.BossRoom.UnityServices.asmdef @@ -6,6 +6,7 @@ "Unity.Services.Authentication", "Unity.Services.Lobbies", "Unity.Services.Relay", + "Unity.Services.Wire.Internal", "Unity.BossRoom.Infrastructure", "VContainer" ], diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dbf3b3ec1..9cb0974a5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,12 +11,17 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Changed * Upgraded editor version to 2022.3.7f1 (#855) * Upgraded Authentication Service package to v2.7.1 - * Upgraded Wire Service package to v1.2.0 * Upgraded Boss Room to Netcode for GameObjects v1.6.0 (#865) * A package Version Define has been created for Netcode for GameObjects v.1.5.2 - v1.6.0. Recent refactorings to NetworkManager's shutdown have prevented the ability to invoke CustomMessages when OnClientDisconnected callbacks are invoked during a shutdown as host. This regression has caused one of our runtime tests, namely Unity.BossRoom.Tests.Runtime.ConnectionManagementTests.UnexpectedServerShutdown_ClientsFailToReconnect, to fail and it does not impact gameplay. This is a known issue and will be addressed in a future NGO version. +### Changed +* Upgraded to Lobby 1.1.0 (#860). + * Lobbies are now locked when being created and are only unlocked when the relay allocation is ready. + * Removed explicit reference to Wire in the package manifest, since Wire is already a dependency of Lobby + ### Fixed * Fixed colliders on diagonal walls to not have negative scale (#854). +* Unnecessary update requests are no longer being sent to Lobby after receiving update events from the service (#860). ## [2.2.0] - 2023-07-06 diff --git a/Packages/manifest.json b/Packages/manifest.json index abb68c8f43..cc3850e868 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -15,9 +15,8 @@ "com.unity.postprocessing": "3.2.2", "com.unity.render-pipelines.universal": "14.0.8", "com.unity.services.authentication": "2.7.1", - "com.unity.services.lobby": "1.1.0-pre.3", + "com.unity.services.lobby": "1.1.0", "com.unity.services.relay": "1.0.5", - "com.unity.services.wire": "1.2.0", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.7.5", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 869a8b6df5..5251b5c2c0 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -242,11 +242,11 @@ "url": "https://packages.unity.com" }, "com.unity.services.lobby": { - "version": "1.1.0-pre.3", + "version": "1.1.0", "depth": 0, "source": "registry", "dependencies": { - "com.unity.services.core": "1.4.2", + "com.unity.services.core": "1.8.2", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", @@ -254,7 +254,7 @@ "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.nuget.newtonsoft-json": "3.0.2", "com.unity.services.authentication": "2.1.1", - "com.unity.services.wire": "1.1.0" + "com.unity.services.wire": "1.1.8" }, "url": "https://packages.unity.com" }, @@ -291,7 +291,7 @@ }, "com.unity.services.wire": { "version": "1.2.0", - "depth": 0, + "depth": 1, "source": "registry", "dependencies": { "com.unity.services.core": "1.10.1", From 910d6c2c8c065c2acd2bc2888133aec4d7483fea Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Thu, 31 Aug 2023 13:20:21 -0400 Subject: [PATCH 05/10] fix: unable to quit application with application exit or in-game exit button [MTT-7003] (#863) * unsubscription on application.wantstoquit to avoid infinite loop * changelog addition * code formatting --- .../ApplicationLifecycle/ApplicationController.cs | 14 ++++++++++---- CHANGELOG.md | 3 +-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs b/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs index b2ba6cd185..874864a40d 100644 --- a/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs +++ b/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs @@ -17,15 +17,17 @@ namespace Unity.BossRoom.ApplicationLifecycle { - /// /// An entry point to the application, where we bind all the common dependencies to the root DI scope. /// public class ApplicationController : LifetimeScope { - [SerializeField] UpdateRunner m_UpdateRunner; - [SerializeField] ConnectionManager m_ConnectionManager; - [SerializeField] NetworkManager m_NetworkManager; + [SerializeField] + UpdateRunner m_UpdateRunner; + [SerializeField] + ConnectionManager m_ConnectionManager; + [SerializeField] + NetworkManager m_NetworkManager; LocalLobby m_LocalLobby; LobbyServiceFacade m_LobbyServiceFacade; @@ -116,17 +118,21 @@ private IEnumerator LeaveBeforeQuit() { Debug.LogError(e.Message); } + yield return null; Application.Quit(); } private bool OnWantToQuit() { + Application.wantsToQuit -= OnWantToQuit; + var canQuit = string.IsNullOrEmpty(m_LocalLobby?.LobbyID); if (!canQuit) { StartCoroutine(LeaveBeforeQuit()); } + return canQuit; } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb0974a5b..8523c57b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,6 @@ Additional documentation and release notes are available at [Multiplayer Documen * Upgraded Authentication Service package to v2.7.1 * Upgraded Boss Room to Netcode for GameObjects v1.6.0 (#865) * A package Version Define has been created for Netcode for GameObjects v.1.5.2 - v1.6.0. Recent refactorings to NetworkManager's shutdown have prevented the ability to invoke CustomMessages when OnClientDisconnected callbacks are invoked during a shutdown as host. This regression has caused one of our runtime tests, namely Unity.BossRoom.Tests.Runtime.ConnectionManagementTests.UnexpectedServerShutdown_ClientsFailToReconnect, to fail and it does not impact gameplay. This is a known issue and will be addressed in a future NGO version. - -### Changed * Upgraded to Lobby 1.1.0 (#860). * Lobbies are now locked when being created and are only unlocked when the relay allocation is ready. * Removed explicit reference to Wire in the package manifest, since Wire is already a dependency of Lobby @@ -22,6 +20,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed * Fixed colliders on diagonal walls to not have negative scale (#854). * Unnecessary update requests are no longer being sent to Lobby after receiving update events from the service (#860). +* Fixed a condition where one would be unable to quit the application through OS-level quit button, nor the in-game quit button (#863) ## [2.2.0] - 2023-07-06 From ba02e059e8b92339961e67a559d25c4afc55b91a Mon Sep 17 00:00:00 2001 From: LPLafontaineB Date: Thu, 31 Aug 2023 14:34:10 -0400 Subject: [PATCH 06/10] fix: loading screen progress not always synced [MTT-6302] (#862) * fixing syncing issue of loading progress --- .../CHANGELOG.md | 5 +++++ .../SceneManagement/LoadingProgressManager.cs | 22 ++++++++++++------- .../NetworkedLoadingProgressTracker.cs | 6 +++++ .../SceneManagement/SceneLoaderWrapper.cs | 1 - 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md index e60a4e88c5..241adfe221 100644 --- a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md +++ b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md @@ -1,5 +1,10 @@ # Multiplayer Samples Co-op Changelog +## [Unreleased] + +### Fixed +* Host loading progress bar is now properly updated on all clients during scene loads (#862) + ## [1.6.1] - 2023-06-14 ### Fixed diff --git a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/LoadingProgressManager.cs b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/LoadingProgressManager.cs index a23fd6b2ce..e92a8d3bcb 100644 --- a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/LoadingProgressManager.cs +++ b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/LoadingProgressManager.cs @@ -27,6 +27,7 @@ public AsyncOperation LocalLoadOperation { set { + m_IsLoading = true; LocalProgress = 0; m_LocalLoadOperation = value; } @@ -36,6 +37,8 @@ public AsyncOperation LocalLoadOperation float m_LocalProgress; + bool m_IsLoading; + /// /// This event is invoked each time the dictionary of progress trackers is updated (if one is removed or added, for example.) /// @@ -51,7 +54,7 @@ public float LocalProgress ProgressTrackers[NetworkManager.LocalClientId].Progress.Value : m_LocalProgress; private set { - if (IsSpawned && ProgressTrackers.ContainsKey(NetworkManager.LocalClientId)) + if (IsSpawned && ProgressTrackers.ContainsKey(NetworkManager.LocalClientId) && ProgressTrackers[NetworkManager.LocalClientId].IsSpawned) { ProgressTrackers[NetworkManager.LocalClientId].Progress.Value = value; } @@ -84,9 +87,17 @@ public override void OnNetworkDespawn() void Update() { - if (m_LocalLoadOperation != null) + if (m_LocalLoadOperation != null && m_IsLoading) { - LocalProgress = m_LocalLoadOperation.isDone ? 1 : m_LocalLoadOperation.progress; + if (m_LocalLoadOperation.isDone) + { + m_IsLoading = false; + LocalProgress = 1; + } + else + { + LocalProgress = m_LocalLoadOperation.progress; + } } } @@ -137,10 +148,5 @@ void RemoveTracker(ulong clientId) } } } - - public void ResetLocalProgress() - { - LocalProgress = 0; - } } } diff --git a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/NetworkedLoadingProgressTracker.cs b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/NetworkedLoadingProgressTracker.cs index 7d69c6a6dc..2735c9ed83 100644 --- a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/NetworkedLoadingProgressTracker.cs +++ b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/NetworkedLoadingProgressTracker.cs @@ -1,4 +1,5 @@ using Unity.Netcode; +using UnityEngine; namespace Unity.Multiplayer.Samples.Utilities { @@ -11,5 +12,10 @@ public class NetworkedLoadingProgressTracker : NetworkBehaviour /// The current loading progress associated with the owner of this NetworkBehavior /// public NetworkVariable Progress { get; } = new NetworkVariable(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); + + void Awake() + { + DontDestroyOnLoad(this); + } } } diff --git a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs index 20488984ba..65c36e72e2 100644 --- a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs +++ b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs @@ -154,7 +154,6 @@ void OnSceneEvent(SceneEvent sceneEvent) if (NetworkManager.IsClient) { m_ClientLoadingScreen.StopLoadingScreen(); - m_LoadingProgressManager.ResetLocalProgress(); } break; case SceneEventType.Synchronize: // Server told client to start synchronizing scenes From b13ad94f013ed1b920cab86b8d00cb4f10801d93 Mon Sep 17 00:00:00 2001 From: LPLafontaineB Date: Thu, 31 Aug 2023 21:09:20 -0400 Subject: [PATCH 07/10] fix: fixing order of components in GameObject containing a NetworkObject component [MTT-6239] (#866) * moving NetworkObject components above NetworkBehaviours in component order in networked prefabs and in-scene placed GameObjects --- Assets/Prefabs/AdditiveSceneLoader.prefab | 40 ++++++++++++------- Assets/Prefabs/DebugCheatsManager.prefab | 34 ++++++++-------- Assets/Prefabs/LoadingProgressTracker.prefab | 26 ++++++------ Assets/Prefabs/NetworkObjectPool.prefab | 42 ++++++++++---------- Assets/Prefabs/SceneLoader.prefab | 30 +++++++------- Assets/Scenes/Startup.unity | 4 +- CHANGELOG.md | 1 + 7 files changed, 95 insertions(+), 82 deletions(-) diff --git a/Assets/Prefabs/AdditiveSceneLoader.prefab b/Assets/Prefabs/AdditiveSceneLoader.prefab index 3246edf083..afa711b690 100644 --- a/Assets/Prefabs/AdditiveSceneLoader.prefab +++ b/Assets/Prefabs/AdditiveSceneLoader.prefab @@ -10,8 +10,8 @@ GameObject: m_Component: - component: {fileID: 3765979716845461200} - component: {fileID: 3765979716845461207} - - component: {fileID: 3765979716845461206} - component: {fileID: 3029178677072641126} + - component: {fileID: 3765979716845461206} m_Layer: 2 m_Name: AdditiveSceneLoader m_TagString: Untagged @@ -26,12 +26,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3765979716845461205} + 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: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &3765979716845461207 BoxCollider: @@ -41,12 +42,20 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3765979716845461205} 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 + serializedVersion: 3 m_Size: {x: 0, y: 0, z: 0} m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &3765979716845461206 +--- !u!114 &3029178677072641126 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -55,13 +64,17 @@ MonoBehaviour: m_GameObject: {fileID: 3765979716845461205} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4506649f88aac74ea839a52818e3174, type: 3} + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - m_DelayBeforeUnload: 5 - m_SceneName: - m_PlayerTag: Player ---- !u!114 &3029178677072641126 + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 1 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &3765979716845461206 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -70,10 +83,9 @@ MonoBehaviour: m_GameObject: {fileID: 3765979716845461205} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Script: {fileID: 11500000, guid: f4506649f88aac74ea839a52818e3174, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 951099334 - AlwaysReplicateAsRoot: 0 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 + m_DelayBeforeUnload: 5 + m_SceneName: + m_PlayerTag: Player diff --git a/Assets/Prefabs/DebugCheatsManager.prefab b/Assets/Prefabs/DebugCheatsManager.prefab index e0c039d45a..636a7db81c 100644 --- a/Assets/Prefabs/DebugCheatsManager.prefab +++ b/Assets/Prefabs/DebugCheatsManager.prefab @@ -9,8 +9,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 2726635115303138402} - - component: {fileID: 7241368247586282332} - component: {fileID: 6695920927348029111} + - component: {fileID: 7241368247586282332} m_Layer: 0 m_Name: DebugCheatsManager m_TagString: Untagged @@ -25,15 +25,15 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 776943915682426285} + 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: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &7241368247586282332 +--- !u!114 &6695920927348029111 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -42,14 +42,17 @@ MonoBehaviour: m_GameObject: {fileID: 776943915682426285} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ab1e76745edfc434ab8154ad27efc5fd, type: 3} + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - m_DebugCheatsPanel: {fileID: 0} - m_EnemyPrefab: {fileID: 3713729372785093435, guid: 6cdd52f1fa2ed34469a487ae6477eded, type: 3} - m_BossPrefab: {fileID: 3688950541947916326, guid: 365e94337fd10fe4ebde1906df413ac7, type: 3} - m_OpenWindowKeyCode: 47 ---- !u!114 &6695920927348029111 + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 0 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &7241368247586282332 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -58,13 +61,10 @@ MonoBehaviour: m_GameObject: {fileID: 776943915682426285} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Script: {fileID: 11500000, guid: ab1e76745edfc434ab8154ad27efc5fd, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 951099334 - AlwaysReplicateAsRoot: 0 - SynchronizeTransform: 0 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 + m_DebugCheatsPanel: {fileID: 0} + m_EnemyPrefab: {fileID: 3713729372785093435, guid: 6cdd52f1fa2ed34469a487ae6477eded, type: 3} + m_BossPrefab: {fileID: 3688950541947916326, guid: 365e94337fd10fe4ebde1906df413ac7, type: 3} + m_OpenWindowKeyCode: 47 diff --git a/Assets/Prefabs/LoadingProgressTracker.prefab b/Assets/Prefabs/LoadingProgressTracker.prefab index cffa6e8780..f2b7923360 100644 --- a/Assets/Prefabs/LoadingProgressTracker.prefab +++ b/Assets/Prefabs/LoadingProgressTracker.prefab @@ -9,8 +9,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 3106828016798330215} - - component: {fileID: 3106828016798330208} - component: {fileID: 3106828016798330209} + - component: {fileID: 3106828016798330208} m_Layer: 0 m_Name: LoadingProgressTracker m_TagString: Untagged @@ -25,15 +25,15 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3106828016798330210} + 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: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &3106828016798330208 +--- !u!114 &3106828016798330209 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -42,10 +42,17 @@ MonoBehaviour: m_GameObject: {fileID: 3106828016798330210} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8e20ce98a70947b68f7982c1c417f88c, type: 3} + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &3106828016798330209 + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 0 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &3106828016798330208 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -54,13 +61,6 @@ MonoBehaviour: m_GameObject: {fileID: 3106828016798330210} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Script: {fileID: 11500000, guid: 8e20ce98a70947b68f7982c1c417f88c, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 951099334 - AlwaysReplicateAsRoot: 0 - SynchronizeTransform: 0 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 diff --git a/Assets/Prefabs/NetworkObjectPool.prefab b/Assets/Prefabs/NetworkObjectPool.prefab index eeee7e8125..3b8fda595f 100644 --- a/Assets/Prefabs/NetworkObjectPool.prefab +++ b/Assets/Prefabs/NetworkObjectPool.prefab @@ -9,8 +9,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 7944773021007068224} - - component: {fileID: 7944773021007068227} - component: {fileID: 8707830667181757321} + - component: {fileID: 7944773021007068227} m_Layer: 0 m_Name: NetworkObjectPool m_TagString: Untagged @@ -25,14 +25,33 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7944773021007068226} + 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: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8707830667181757321 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7944773021007068226} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 0 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 --- !u!114 &7944773021007068227 MonoBehaviour: m_ObjectHideFlags: 0 @@ -56,22 +75,3 @@ MonoBehaviour: PrewarmCount: 5 - Prefab: {fileID: 5473352307376472481, guid: 3e5c32e5766633a4eaf9e7c393418b34, type: 3} PrewarmCount: 5 ---- !u!114 &8707830667181757321 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7944773021007068226} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} - m_Name: - m_EditorClassIdentifier: - GlobalObjectIdHash: 951099334 - AlwaysReplicateAsRoot: 0 - SynchronizeTransform: 0 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 diff --git a/Assets/Prefabs/SceneLoader.prefab b/Assets/Prefabs/SceneLoader.prefab index 5722dc77f4..cc192894c3 100644 --- a/Assets/Prefabs/SceneLoader.prefab +++ b/Assets/Prefabs/SceneLoader.prefab @@ -9,8 +9,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 7533068275093218427} - - component: {fileID: 2071498811241465156} - component: {fileID: 8734696198808489477} + - component: {fileID: 2071498811241465156} - component: {fileID: 6240023712540756099} m_Layer: 0 m_Name: SceneLoader @@ -26,15 +26,15 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5970766024194302363} + 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: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2071498811241465156 +--- !u!114 &8734696198808489477 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -43,12 +43,17 @@ MonoBehaviour: m_GameObject: {fileID: 5970766024194302363} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d202c9ed4a2c4a6fa83f21f1c21394ea, type: 3} + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - m_ClientLoadingScreen: {fileID: 0} - m_LoadingProgressManager: {fileID: 6240023712540756099} ---- !u!114 &8734696198808489477 + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 0 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &2071498811241465156 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -57,16 +62,11 @@ MonoBehaviour: m_GameObject: {fileID: 5970766024194302363} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Script: {fileID: 11500000, guid: d202c9ed4a2c4a6fa83f21f1c21394ea, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 951099334 - AlwaysReplicateAsRoot: 0 - SynchronizeTransform: 0 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 + m_ClientLoadingScreen: {fileID: 0} + m_LoadingProgressManager: {fileID: 6240023712540756099} --- !u!114 &6240023712540756099 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Startup.unity b/Assets/Scenes/Startup.unity index 5b88ce254b..46661151e3 100644 --- a/Assets/Scenes/Startup.unity +++ b/Assets/Scenes/Startup.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:23e64f176df19566b90ab728417990e715e937d86d6499e1b1d537c39e9fe63a -size 52979 +oid sha256:daaa3847b041faeb0af9f4962967b3883af1a3f20ca0ad4dd9b7e2f07c2fc0e3 +size 59280 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8523c57b7b..6282ad5a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed * Fixed colliders on diagonal walls to not have negative scale (#854). +* Fixed order of components in networked GameObjects (#866). NetworkObjects are now always above NetworkBehaviours in the component order in GameObjects. This fixes a bug where during scene unloading the NetworkBehaviours would be destroyed before the NetworkObject on the host, which caused these NetworkBehaviours to not have their OnNetworkDespawned invoked in that situation on the host. * Unnecessary update requests are no longer being sent to Lobby after receiving update events from the service (#860). * Fixed a condition where one would be unable to quit the application through OS-level quit button, nor the in-game quit button (#863) From 10ba2ae52715d573f6551113dffdb0a1921dc1b9 Mon Sep 17 00:00:00 2001 From: LPLafontaineB Date: Tue, 5 Sep 2023 11:44:42 -0400 Subject: [PATCH 08/10] fix: clarifying additive scene synchronization fix for reconnection flow [MTT-3450] (#864) * clarify comments about where some scene events are executed * clarifying comments about fix for additive scenes when synchronizing --- .../CHANGELOG.md | 3 ++- .../SceneManagement/SceneLoaderWrapper.cs | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md index 241adfe221..fa21961485 100644 --- a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md +++ b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md @@ -1,8 +1,9 @@ # Multiplayer Samples Co-op Changelog -## [Unreleased] +## [Unreleased] - yyyy-mm-dd ### Fixed +* Clarified fix used to handle clients reconnecting to the server while keeping the same active scene and having additional scenes additively loaded (#864) * Host loading progress bar is now properly updated on all clients during scene loads (#862) ## [1.6.1] - 2023-06-14 diff --git a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs index 65c36e72e2..7e8934e8f2 100644 --- a/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs +++ b/Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/SceneLoaderWrapper.cs @@ -133,7 +133,7 @@ void OnSceneEvent(SceneEvent sceneEvent) switch (sceneEvent.SceneEventType) { case SceneEventType.Load: // Server told client to load a scene - // Only executes on client + // Only executes on client or host if (NetworkManager.IsClient) { // Only start a new loading screen if scene loaded in Single mode, else simply update @@ -150,7 +150,7 @@ void OnSceneEvent(SceneEvent sceneEvent) } break; case SceneEventType.LoadEventCompleted: // Server told client that all clients finished loading a scene - // Only executes on client + // Only executes on client or host if (NetworkManager.IsClient) { m_ClientLoadingScreen.StopLoadingScreen(); @@ -158,14 +158,21 @@ void OnSceneEvent(SceneEvent sceneEvent) break; case SceneEventType.Synchronize: // Server told client to start synchronizing scenes { - // todo: this is a workaround that could be removed once MTT-3363 is done // Only executes on client that is not the host if (NetworkManager.IsClient && !NetworkManager.IsHost) { - // unload all currently loaded additive scenes so that if we connect to a server with the same - // main scene we properly load and synchronize all appropriate scenes without loading a scene - // that is already loaded. - UnloadAdditiveScenes(); + if (NetworkManager.SceneManager.ClientSynchronizationMode == LoadSceneMode.Single) + { + // If using the Single ClientSynchronizationMode, unload all currently loaded additive + // scenes. In this case, we want the client to only keep the same scenes loaded as the + // server. Netcode For GameObjects will automatically handle loading all the scenes that the + // server has loaded to the client during the synchronization process. If the server's main + // scene is different to the client's, it will start by loading that scene in single mode, + // unloading every additively loaded scene in the process. However, if the server's main + // scene is the same as the client's, it will not automatically unload additive scenes, so + // we do it manually here. + UnloadAdditiveScenes(); + } } break; } From 5a1de631ac8363bf06a86543a972f2bc1dbf0738 Mon Sep 17 00:00:00 2001 From: LPLafontaineB Date: Wed, 6 Sep 2023 12:34:19 -0400 Subject: [PATCH 09/10] fix: replace null-coalescencing and null-conditional operators [MTT-7125] (#867) * removing uses of the null-coalescing operator * replacing null-conditional operators with regular null checks --- .../ApplicationController.cs | 14 +++++++++--- .../ConnectionState/HostingState.cs | 14 +++++++++++- .../Gameplay/GameState/ServerBossRoomState.cs | 11 ++++++++-- .../Character/ServerCharacterMovement.cs | 5 ++++- .../Gameplay/GameplayObjects/SwitchedDoor.cs | 5 ++++- .../UI/ConnectionStatusMessageUIManager.cs | 5 ++++- .../Scripts/Gameplay/UI/IPConnectionWindow.cs | 5 ++++- Assets/Scripts/Gameplay/UI/IPUIMediator.cs | 5 ++++- .../Gameplay/UI/Lobby/LobbyJoiningUI.cs | 7 ++++-- .../Gameplay/UI/Lobby/LobbyUIMediator.cs | 5 ++++- Assets/Scripts/Gameplay/UI/UIMessageFeed.cs | 5 ++++- .../Gameplay/UI/UnityServicesUIHandler.cs | 5 ++++- .../Infrastructure/PubSub/MessageChannel.cs | 5 ++++- .../Auth/AuthenticationServiceFacade.cs | 10 ++++----- .../Lobbies/LobbyServiceFacade.cs | 18 +++++++++++---- .../UnityServices/Lobbies/LocalLobby.cs | 2 +- .../Utils/NetworkSimulatorUIMediator.cs | 6 ++++- Assets/Scripts/Utils/ProfileManager.cs | 7 +++++- CHANGELOG.md | 1 + .../CHANGELOG.md | 3 +++ .../Utilities/EditorChildSceneLoader.cs | 10 +++++++-- .../Utilities/Net/SessionManager.cs | 22 +++++++++++++++---- 22 files changed, 135 insertions(+), 35 deletions(-) diff --git a/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs b/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs index 874864a40d..499701fc2c 100644 --- a/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs +++ b/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs @@ -98,8 +98,16 @@ private void Start() protected override void OnDestroy() { - m_Subscriptions?.Dispose(); - m_LobbyServiceFacade?.EndTracking(); + if (m_Subscriptions != null) + { + m_Subscriptions.Dispose(); + } + + if (m_LobbyServiceFacade != null) + { + m_LobbyServiceFacade.EndTracking(); + } + base.OnDestroy(); } @@ -127,7 +135,7 @@ private bool OnWantToQuit() { Application.wantsToQuit -= OnWantToQuit; - var canQuit = string.IsNullOrEmpty(m_LocalLobby?.LobbyID); + var canQuit = m_LocalLobby != null && string.IsNullOrEmpty(m_LocalLobby.LobbyID); if (!canQuit) { StartCoroutine(LeaveBeforeQuit()); diff --git a/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs b/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs index 45c5b20a6d..b0645e21eb 100644 --- a/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs +++ b/Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs @@ -42,7 +42,19 @@ public override void Exit() public override void OnClientConnected(ulong clientId) { - m_ConnectionEventPublisher.Publish(new ConnectionEventMessage() { ConnectStatus = ConnectStatus.Success, PlayerName = SessionManager.Instance.GetPlayerData(clientId)?.PlayerName }); + var playerData = SessionManager.Instance.GetPlayerData(clientId); + if (playerData != null) + { + m_ConnectionEventPublisher.Publish(new ConnectionEventMessage() { ConnectStatus = ConnectStatus.Success, PlayerName = playerData.Value.PlayerName }); + } + else + { + // This should not happen since player data is assigned during connection approval + Debug.LogError($"No player data associated with client {clientId}"); + var reason = JsonUtility.ToJson(ConnectStatus.GenericDisconnect); + m_ConnectionManager.NetworkManager.DisconnectClient(clientId, reason); + } + } public override void OnClientDisconnect(ulong clientId) diff --git a/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs b/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs index 272593970b..71bfdb747d 100644 --- a/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs +++ b/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs @@ -88,7 +88,11 @@ void OnNetworkSpawn() void OnNetworkDespawn() { - m_LifeStateChangedEventMessageSubscriber?.Unsubscribe(OnLifeStateChangedEventMessage); + if (m_LifeStateChangedEventMessageSubscriber != null) + { + m_LifeStateChangedEventMessageSubscriber.Unsubscribe(OnLifeStateChangedEventMessage); + } + NetworkManager.Singleton.OnClientDisconnectCallback -= OnClientDisconnect; NetworkManager.Singleton.SceneManager.OnLoadEventCompleted -= OnLoadEventCompleted; NetworkManager.Singleton.SceneManager.OnSynchronizeComplete -= OnSynchronizeComplete; @@ -96,7 +100,10 @@ void OnNetworkDespawn() protected override void OnDestroy() { - m_LifeStateChangedEventMessageSubscriber?.Unsubscribe(OnLifeStateChangedEventMessage); + if (m_LifeStateChangedEventMessageSubscriber != null) + { + m_LifeStateChangedEventMessageSubscriber.Unsubscribe(OnLifeStateChangedEventMessage); + } if (m_NetcodeHooks) { diff --git a/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacterMovement.cs b/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacterMovement.cs index 5fb40a57b0..c90b75a690 100644 --- a/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacterMovement.cs +++ b/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacterMovement.cs @@ -141,7 +141,10 @@ public bool IsMoving() /// public void CancelMove() { - m_NavPath?.Clear(); + if (m_NavPath != null) + { + m_NavPath.Clear(); + } m_MovementState = MovementState.Idle; } diff --git a/Assets/Scripts/Gameplay/GameplayObjects/SwitchedDoor.cs b/Assets/Scripts/Gameplay/GameplayObjects/SwitchedDoor.cs index 426fc340cd..ebc2ee5f7e 100644 --- a/Assets/Scripts/Gameplay/GameplayObjects/SwitchedDoor.cs +++ b/Assets/Scripts/Gameplay/GameplayObjects/SwitchedDoor.cs @@ -100,7 +100,10 @@ void OnDoorStateChanged(bool wasDoorOpen, bool isDoorOpen) if (IsClient) { m_PhysicsObject.SetActive(!isDoorOpen); - m_Publisher?.Publish(new DoorStateChangedEventMessage() { IsDoorOpen = isDoorOpen }); + if (m_Publisher != null) + { + m_Publisher.Publish(new DoorStateChangedEventMessage() { IsDoorOpen = isDoorOpen }); + } } } diff --git a/Assets/Scripts/Gameplay/UI/ConnectionStatusMessageUIManager.cs b/Assets/Scripts/Gameplay/UI/ConnectionStatusMessageUIManager.cs index e41ddcbdba..bb25892137 100644 --- a/Assets/Scripts/Gameplay/UI/ConnectionStatusMessageUIManager.cs +++ b/Assets/Scripts/Gameplay/UI/ConnectionStatusMessageUIManager.cs @@ -30,7 +30,10 @@ void Awake() void OnDestroy() { - m_Subscriptions?.Dispose(); + if (m_Subscriptions != null) + { + m_Subscriptions.Dispose(); + } } void OnConnectStatus(ConnectStatus status) diff --git a/Assets/Scripts/Gameplay/UI/IPConnectionWindow.cs b/Assets/Scripts/Gameplay/UI/IPConnectionWindow.cs index cc4e1d8ae7..8e802727e6 100644 --- a/Assets/Scripts/Gameplay/UI/IPConnectionWindow.cs +++ b/Assets/Scripts/Gameplay/UI/IPConnectionWindow.cs @@ -36,7 +36,10 @@ void Awake() void OnDestroy() { - m_ConnectStatusSubscriber?.Unsubscribe(OnConnectStatusMessage); + if (m_ConnectStatusSubscriber != null) + { + m_ConnectStatusSubscriber.Unsubscribe(OnConnectStatusMessage); + } } void OnConnectStatusMessage(ConnectStatus connectStatus) diff --git a/Assets/Scripts/Gameplay/UI/IPUIMediator.cs b/Assets/Scripts/Gameplay/UI/IPUIMediator.cs index 8c81d4b65c..565b66bd27 100644 --- a/Assets/Scripts/Gameplay/UI/IPUIMediator.cs +++ b/Assets/Scripts/Gameplay/UI/IPUIMediator.cs @@ -65,7 +65,10 @@ void Start() void OnDestroy() { - m_ConnectStatusSubscriber?.Unsubscribe(OnConnectStatusMessage); + if (m_ConnectStatusSubscriber != null) + { + m_ConnectStatusSubscriber.Unsubscribe(OnConnectStatusMessage); + } } void OnConnectStatusMessage(ConnectStatus connectStatus) diff --git a/Assets/Scripts/Gameplay/UI/Lobby/LobbyJoiningUI.cs b/Assets/Scripts/Gameplay/UI/Lobby/LobbyJoiningUI.cs index 41e91e3634..fdff41faa2 100644 --- a/Assets/Scripts/Gameplay/UI/Lobby/LobbyJoiningUI.cs +++ b/Assets/Scripts/Gameplay/UI/Lobby/LobbyJoiningUI.cs @@ -41,13 +41,16 @@ void OnDisable() { if (m_UpdateRunner != null) { - m_UpdateRunner?.Unsubscribe(PeriodicRefresh); + m_UpdateRunner.Unsubscribe(PeriodicRefresh); } } void OnDestroy() { - m_LocalLobbiesRefreshedSub?.Unsubscribe(UpdateUI); + if (m_LocalLobbiesRefreshedSub != null) + { + m_LocalLobbiesRefreshedSub.Unsubscribe(UpdateUI); + } } [Inject] diff --git a/Assets/Scripts/Gameplay/UI/Lobby/LobbyUIMediator.cs b/Assets/Scripts/Gameplay/UI/Lobby/LobbyUIMediator.cs index c742627088..d79d7645bb 100644 --- a/Assets/Scripts/Gameplay/UI/Lobby/LobbyUIMediator.cs +++ b/Assets/Scripts/Gameplay/UI/Lobby/LobbyUIMediator.cs @@ -66,7 +66,10 @@ void OnConnectStatus(ConnectStatus status) void OnDestroy() { - m_ConnectStatusSubscriber?.Unsubscribe(OnConnectStatus); + if (m_ConnectStatusSubscriber != null) + { + m_ConnectStatusSubscriber.Unsubscribe(OnConnectStatus); + } } //Lobby and Relay calls done from UI diff --git a/Assets/Scripts/Gameplay/UI/UIMessageFeed.cs b/Assets/Scripts/Gameplay/UI/UIMessageFeed.cs index 9f3eb94731..35a563e890 100644 --- a/Assets/Scripts/Gameplay/UI/UIMessageFeed.cs +++ b/Assets/Scripts/Gameplay/UI/UIMessageFeed.cs @@ -124,7 +124,10 @@ UIMessageSlot GetAvailableSlot() void OnDestroy() { - m_Subscriptions?.Dispose(); + if (m_Subscriptions != null) + { + m_Subscriptions.Dispose(); + } } } diff --git a/Assets/Scripts/Gameplay/UI/UnityServicesUIHandler.cs b/Assets/Scripts/Gameplay/UI/UnityServicesUIHandler.cs index 37be5edde0..fba0fc3367 100644 --- a/Assets/Scripts/Gameplay/UI/UnityServicesUIHandler.cs +++ b/Assets/Scripts/Gameplay/UI/UnityServicesUIHandler.cs @@ -87,7 +87,10 @@ void HandleLobbyError(UnityServiceErrorMessage error) void OnDestroy() { - m_ServiceErrorSubscription?.Unsubscribe(ServiceErrorHandler); + if (m_ServiceErrorSubscription != null) + { + m_ServiceErrorSubscription.Unsubscribe(ServiceErrorHandler); + } } } } diff --git a/Assets/Scripts/Infrastructure/PubSub/MessageChannel.cs b/Assets/Scripts/Infrastructure/PubSub/MessageChannel.cs index faa1090d33..116ef51407 100644 --- a/Assets/Scripts/Infrastructure/PubSub/MessageChannel.cs +++ b/Assets/Scripts/Infrastructure/PubSub/MessageChannel.cs @@ -42,7 +42,10 @@ public virtual void Publish(T message) foreach (var messageHandler in m_MessageHandlers) { - messageHandler?.Invoke(message); + if (messageHandler != null) + { + messageHandler.Invoke(message); + } } } diff --git a/Assets/Scripts/UnityServices/Auth/AuthenticationServiceFacade.cs b/Assets/Scripts/UnityServices/Auth/AuthenticationServiceFacade.cs index ef26eceeb7..95d51ce07b 100644 --- a/Assets/Scripts/UnityServices/Auth/AuthenticationServiceFacade.cs +++ b/Assets/Scripts/UnityServices/Auth/AuthenticationServiceFacade.cs @@ -27,7 +27,7 @@ public InitializationOptions GenerateAuthenticationOptions(string profile) } catch (Exception e) { - var reason = $"{e.Message} ({e.InnerException?.Message})"; + var reason = e.InnerException == null ? e.Message : $"{e.Message} ({e.InnerException.Message})"; m_UnityServiceErrorMessagePublisher.Publish(new UnityServiceErrorMessage("Authentication Error", reason, UnityServiceErrorMessage.Service.Authentication, e)); throw; } @@ -46,7 +46,7 @@ public async Task InitializeAndSignInAsync(InitializationOptions initializationO } catch (Exception e) { - var reason = $"{e.Message} ({e.InnerException?.Message})"; + var reason = e.InnerException == null ? e.Message : $"{e.Message} ({e.InnerException.Message})"; m_UnityServiceErrorMessagePublisher.Publish(new UnityServiceErrorMessage("Authentication Error", reason, UnityServiceErrorMessage.Service.Authentication, e)); throw; } @@ -67,7 +67,7 @@ public async Task SwitchProfileAndReSignInAsync(string profile) } catch (Exception e) { - var reason = $"{e.Message} ({e.InnerException?.Message})"; + var reason = e.InnerException == null ? e.Message : $"{e.Message} ({e.InnerException.Message})"; m_UnityServiceErrorMessagePublisher.Publish(new UnityServiceErrorMessage("Authentication Error", reason, UnityServiceErrorMessage.Service.Authentication, e)); throw; } @@ -87,7 +87,7 @@ public async Task EnsurePlayerIsAuthorized() } catch (AuthenticationException e) { - var reason = $"{e.Message} ({e.InnerException?.Message})"; + var reason = e.InnerException == null ? e.Message : $"{e.Message} ({e.InnerException.Message})"; m_UnityServiceErrorMessagePublisher.Publish(new UnityServiceErrorMessage("Authentication Error", reason, UnityServiceErrorMessage.Service.Authentication, e)); //not rethrowing for authentication exceptions - any failure to authenticate is considered "handled failure" @@ -96,7 +96,7 @@ public async Task EnsurePlayerIsAuthorized() catch (Exception e) { //all other exceptions should still bubble up as unhandled ones - var reason = $"{e.Message} ({e.InnerException?.Message})"; + var reason = e.InnerException == null ? e.Message : $"{e.Message} ({e.InnerException.Message})"; m_UnityServiceErrorMessagePublisher.Publish(new UnityServiceErrorMessage("Authentication Error", reason, UnityServiceErrorMessage.Service.Authentication, e)); throw; } diff --git a/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs b/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs index 4a34c7ddc8..a07e643cca 100644 --- a/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs +++ b/Assets/Scripts/UnityServices/Lobbies/LobbyServiceFacade.cs @@ -228,8 +228,14 @@ public void EndTracking() void ResetLobby() { CurrentUnityLobby = null; - m_LocalUser.ResetState(); - m_LocalLobby?.Reset(m_LocalUser); + if (m_LocalUser != null) + { + m_LocalUser.ResetState(); + } + if (m_LocalLobby != null) + { + m_LocalLobby.Reset(m_LocalUser); + } // no need to disconnect Netcode, it should already be handled by Netcode's callback to disconnect } @@ -471,7 +477,11 @@ public async Task UpdateLobbyDataAndUnlockAsync() var localData = m_LocalLobby.GetDataForUnityServices(); - var dataCurr = CurrentUnityLobby.Data ?? new Dictionary(); + var dataCurr = CurrentUnityLobby.Data; + if (dataCurr == null) + { + dataCurr = new Dictionary(); + } foreach (var dataNew in localData) { @@ -533,7 +543,7 @@ void DoLobbyHeartbeat(float dt) void PublishError(LobbyServiceException e) { - var reason = $"{e.Message} ({e.InnerException?.Message})"; // Lobby error type, then HTTP error type. + var reason = e.InnerException == null ? e.Message : $"{e.Message} ({e.InnerException.Message})"; // Lobby error type, then HTTP error type. m_UnityServiceErrorMessagePub.Publish(new UnityServiceErrorMessage("Lobby Error", reason, UnityServiceErrorMessage.Service.Lobby, e)); } } diff --git a/Assets/Scripts/UnityServices/Lobbies/LocalLobby.cs b/Assets/Scripts/UnityServices/Lobbies/LocalLobby.cs index 9629bfdef1..2008e6af9a 100644 --- a/Assets/Scripts/UnityServices/Lobbies/LocalLobby.cs +++ b/Assets/Scripts/UnityServices/Lobbies/LocalLobby.cs @@ -255,7 +255,7 @@ public void ApplyRemoteData(Lobby lobby) var incomingData = new LocalLobbyUser { IsHost = lobby.HostId.Equals(player.Id), - DisplayName = player.Data?.ContainsKey("DisplayName") == true ? player.Data["DisplayName"].Value : default, + DisplayName = player.Data != null && player.Data.ContainsKey("DisplayName") ? player.Data["DisplayName"].Value : default, ID = player.Id }; diff --git a/Assets/Scripts/Utils/NetworkSimulatorUIMediator.cs b/Assets/Scripts/Utils/NetworkSimulatorUIMediator.cs index 48413dd9d5..a80f4ef3e6 100644 --- a/Assets/Scripts/Utils/NetworkSimulatorUIMediator.cs +++ b/Assets/Scripts/Utils/NetworkSimulatorUIMediator.cs @@ -144,7 +144,11 @@ void OnScenarioChanged(int optionIndex) break; } m_NetworkSimulator.Scenario = scenario; - m_NetworkSimulator.Scenario?.Start(m_NetworkSimulator); + if (m_NetworkSimulator.Scenario != null) + { + m_NetworkSimulator.Scenario.Start(m_NetworkSimulator); + } + UpdateScenarioButton(); } diff --git a/Assets/Scripts/Utils/ProfileManager.cs b/Assets/Scripts/Utils/ProfileManager.cs index 466e60a8c6..7e47f4077d 100644 --- a/Assets/Scripts/Utils/ProfileManager.cs +++ b/Assets/Scripts/Utils/ProfileManager.cs @@ -21,7 +21,12 @@ public string Profile { get { - return m_Profile ??= GetProfile(); + if (m_Profile == null) + { + m_Profile = GetProfile(); + } + + return m_Profile; } set { diff --git a/CHANGELOG.md b/CHANGELOG.md index 6282ad5a96..2e4ae0e945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Changed * Upgraded editor version to 2022.3.7f1 (#855) * Upgraded Authentication Service package to v2.7.1 +* Replaced usages of null-coalescing and null-conditional operators with regular null checks. (#867) These operators can cause issues when used with types inheriting UnityEngine.Object because that type redefines the == operator to define when an object is null. This redefinition applies to regular null checks (if foo == null) but not to those operators, thus this could lead to unexpected behaviour. While those operators were safely used within Boss Room, only with types that were not inheriting UnityEngine.Object, we decided to remove most usages for consistency. This will also help avoid accidental mistakes, such as a user reusing a part of this code, but modifying it so that one of those operators are used with a UnityEngine.Object. * Upgraded Boss Room to Netcode for GameObjects v1.6.0 (#865) * A package Version Define has been created for Netcode for GameObjects v.1.5.2 - v1.6.0. Recent refactorings to NetworkManager's shutdown have prevented the ability to invoke CustomMessages when OnClientDisconnected callbacks are invoked during a shutdown as host. This regression has caused one of our runtime tests, namely Unity.BossRoom.Tests.Runtime.ConnectionManagementTests.UnexpectedServerShutdown_ClientsFailToReconnect, to fail and it does not impact gameplay. This is a known issue and will be addressed in a future NGO version. * Upgraded to Lobby 1.1.0 (#860). diff --git a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md index fa21961485..1ffdc86073 100644 --- a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md +++ b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased] - yyyy-mm-dd +### Changed +* Replaced usages of null-coalescing and null-conditional operators with regular null checks. (#867) These operators can cause issues when used with types inheriting UnityEngine.Object because that type redefines the == operator to define when an object is null. This redefinition applies to regular null checks (if foo == null) but not to those operators, thus this could lead to unexpected behaviour. While those operators were safely used within Boss Room, only with types that were not inheriting UnityEngine.Object, we decided to remove most usages for consistency. This will also help avoid accidental mistakes, such as a user reusing a part of this code, but modifying it so that one of those operators are used with a UnityEngine.Object. + ### Fixed * Clarified fix used to handle clients reconnecting to the server while keeping the same active scene and having additional scenes additively loaded (#864) * Host loading progress bar is now properly updated on all clients during scene loads (#862) diff --git a/Packages/com.unity.multiplayer.samples.coop/Utilities/EditorChildSceneLoader.cs b/Packages/com.unity.multiplayer.samples.coop/Utilities/EditorChildSceneLoader.cs index 6cf14c9d31..b7fe4dcae0 100644 --- a/Packages/com.unity.multiplayer.samples.coop/Utilities/EditorChildSceneLoader.cs +++ b/Packages/com.unity.multiplayer.samples.coop/Utilities/EditorChildSceneLoader.cs @@ -23,8 +23,14 @@ void Update() public void SaveSceneSetup() { - ChildScenesToLoadConfig ??= new List(); - ChildScenesToLoadConfig.Clear(); + if (ChildScenesToLoadConfig == null) + { + ChildScenesToLoadConfig = new List(); + } + else + { + ChildScenesToLoadConfig.Clear(); + } foreach (var sceneSetup in EditorSceneManager.GetSceneManagerSetup()) { ChildScenesToLoadConfig.Add(AssetDatabase.LoadAssetAtPath(sceneSetup.path)); diff --git a/Packages/com.unity.multiplayer.samples.coop/Utilities/Net/SessionManager.cs b/Packages/com.unity.multiplayer.samples.coop/Utilities/Net/SessionManager.cs index 6209453eb4..1b0d837182 100644 --- a/Packages/com.unity.multiplayer.samples.coop/Utilities/Net/SessionManager.cs +++ b/Packages/com.unity.multiplayer.samples.coop/Utilities/Net/SessionManager.cs @@ -30,7 +30,18 @@ public class SessionManager where T : struct, ISessionPlayerData m_ClientIDToPlayerId = new Dictionary(); } - public static SessionManager Instance => s_Instance ??= new SessionManager(); + public static SessionManager Instance + { + get + { + if (s_Instance == null) + { + s_Instance = new SessionManager(); + } + + return s_Instance; + } + } static SessionManager s_Instance; @@ -56,7 +67,8 @@ public void DisconnectClient(ulong clientId) // Mark client as disconnected, but keep their data so they can reconnect. if (m_ClientIDToPlayerId.TryGetValue(clientId, out var playerId)) { - if (GetPlayerData(playerId)?.ClientID == clientId) + var playerData = GetPlayerData(playerId); + if (playerData != null && playerData.Value.ClientID == clientId) { var clientData = m_ClientData[playerId]; clientData.IsConnected = false; @@ -70,7 +82,8 @@ public void DisconnectClient(ulong clientId) if (m_ClientIDToPlayerId.TryGetValue(clientId, out var playerId)) { m_ClientIDToPlayerId.Remove(clientId); - if (GetPlayerData(playerId)?.ClientID == clientId) + var playerData = GetPlayerData(playerId); + if (playerData != null && playerData.Value.ClientID == clientId) { m_ClientData.Remove(playerId); } @@ -251,7 +264,8 @@ void ClearDisconnectedPlayersData() foreach (var id in idsToClear) { string playerId = m_ClientIDToPlayerId[id]; - if (GetPlayerData(playerId)?.ClientID == id) + var playerData = GetPlayerData(playerId); + if (playerData != null && playerData.Value.ClientID == id) { m_ClientData.Remove(playerId); } From 2a4903b570f9c7bcf819d622923a9a806871aa3f Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Thu, 7 Sep 2023 17:06:20 -0400 Subject: [PATCH 10/10] chore: v2.3.0 release update (#869) * project settings & changelog updated * utilities package dependencies updated as well, version bump --- CHANGELOG.md | 2 +- Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md | 8 +++++++- Packages/com.unity.multiplayer.samples.coop/package.json | 6 +++--- Packages/packages-lock.json | 6 +++--- ProjectSettings/ProjectSettings.asset | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e4ae0e945..6346cdaf51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com). -## [Unreleased] - yyyy-mm-dd +## [2.3.0] - 2023-09-07 ### Changed * Upgraded editor version to 2022.3.7f1 (#855) diff --git a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md index 1ffdc86073..94dce858a8 100644 --- a/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md +++ b/Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md @@ -1,6 +1,12 @@ # Multiplayer Samples Co-op Changelog -## [Unreleased] - yyyy-mm-dd +## [1.7.0] - 2023-09-07 + +### Changed +* Updating package dependencies (#869) + * Tutorial Framework upgraded to v3.1.3 + * Netcode for GameObjects upgraded to v1.6.0 + * Unity Relay upgraded to v1.0.5 ### Changed * Replaced usages of null-coalescing and null-conditional operators with regular null checks. (#867) These operators can cause issues when used with types inheriting UnityEngine.Object because that type redefines the == operator to define when an object is null. This redefinition applies to regular null checks (if foo == null) but not to those operators, thus this could lead to unexpected behaviour. While those operators were safely used within Boss Room, only with types that were not inheriting UnityEngine.Object, we decided to remove most usages for consistency. This will also help avoid accidental mistakes, such as a user reusing a part of this code, but modifying it so that one of those operators are used with a UnityEngine.Object. diff --git a/Packages/com.unity.multiplayer.samples.coop/package.json b/Packages/com.unity.multiplayer.samples.coop/package.json index 6a5bbf7088..1c1d942c3b 100644 --- a/Packages/com.unity.multiplayer.samples.coop/package.json +++ b/Packages/com.unity.multiplayer.samples.coop/package.json @@ -7,9 +7,9 @@ "unity": "2020.3", "description": "Utilities package built on top of Netcode for GameObjects, providing useful scripts and tools.", "dependencies": { - "com.unity.learn.iet-framework": "1.2.1", + "com.unity.learn.iet-framework": "3.1.3", "com.unity.multiplayer.tools": "1.1.0", - "com.unity.netcode.gameobjects": "1.4.0", - "com.unity.services.relay": "1.0.3" + "com.unity.netcode.gameobjects": "1.6.0", + "com.unity.services.relay": "1.0.5" } } \ No newline at end of file diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 5251b5c2c0..08daed58d3 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -121,10 +121,10 @@ "depth": 0, "source": "embedded", "dependencies": { - "com.unity.learn.iet-framework": "1.2.1", + "com.unity.learn.iet-framework": "3.1.3", "com.unity.multiplayer.tools": "1.1.0", - "com.unity.netcode.gameobjects": "1.4.0", - "com.unity.services.relay": "1.0.3" + "com.unity.netcode.gameobjects": "1.6.0", + "com.unity.services.relay": "1.0.5" } }, "com.unity.multiplayer.tools": { diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 83c7682180..5cc42a20f9 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3cabe86404e4b93444944c7a3fd899524121a1061d652bbf5ff2f41b81a4d32 +oid sha256:64b4451c53ca78def1a82ed366a92399fce17e936d3c4e4e370f3f5b57d3f9ad size 26959