Skip to content

Commit b13ad94

Browse files
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
1 parent ba02e05 commit b13ad94

File tree

7 files changed

+95
-82
lines changed

7 files changed

+95
-82
lines changed

Assets/Prefabs/AdditiveSceneLoader.prefab

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ GameObject:
1010
m_Component:
1111
- component: {fileID: 3765979716845461200}
1212
- component: {fileID: 3765979716845461207}
13-
- component: {fileID: 3765979716845461206}
1413
- component: {fileID: 3029178677072641126}
14+
- component: {fileID: 3765979716845461206}
1515
m_Layer: 2
1616
m_Name: AdditiveSceneLoader
1717
m_TagString: Untagged
@@ -26,12 +26,13 @@ Transform:
2626
m_PrefabInstance: {fileID: 0}
2727
m_PrefabAsset: {fileID: 0}
2828
m_GameObject: {fileID: 3765979716845461205}
29+
serializedVersion: 2
2930
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
3031
m_LocalPosition: {x: 0, y: 0, z: 0}
3132
m_LocalScale: {x: 1, y: 1, z: 1}
33+
m_ConstrainProportionsScale: 0
3234
m_Children: []
3335
m_Father: {fileID: 0}
34-
m_RootOrder: 0
3536
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
3637
--- !u!65 &3765979716845461207
3738
BoxCollider:
@@ -41,12 +42,20 @@ BoxCollider:
4142
m_PrefabAsset: {fileID: 0}
4243
m_GameObject: {fileID: 3765979716845461205}
4344
m_Material: {fileID: 0}
45+
m_IncludeLayers:
46+
serializedVersion: 2
47+
m_Bits: 0
48+
m_ExcludeLayers:
49+
serializedVersion: 2
50+
m_Bits: 0
51+
m_LayerOverridePriority: 0
4452
m_IsTrigger: 1
53+
m_ProvidesContacts: 0
4554
m_Enabled: 1
46-
serializedVersion: 2
55+
serializedVersion: 3
4756
m_Size: {x: 0, y: 0, z: 0}
4857
m_Center: {x: 0, y: 0, z: 0}
49-
--- !u!114 &3765979716845461206
58+
--- !u!114 &3029178677072641126
5059
MonoBehaviour:
5160
m_ObjectHideFlags: 0
5261
m_CorrespondingSourceObject: {fileID: 0}
@@ -55,13 +64,17 @@ MonoBehaviour:
5564
m_GameObject: {fileID: 3765979716845461205}
5665
m_Enabled: 1
5766
m_EditorHideFlags: 0
58-
m_Script: {fileID: 11500000, guid: f4506649f88aac74ea839a52818e3174, type: 3}
67+
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
5968
m_Name:
6069
m_EditorClassIdentifier:
61-
m_DelayBeforeUnload: 5
62-
m_SceneName:
63-
m_PlayerTag: Player
64-
--- !u!114 &3029178677072641126
70+
GlobalObjectIdHash: 951099334
71+
AlwaysReplicateAsRoot: 0
72+
SynchronizeTransform: 1
73+
ActiveSceneSynchronization: 0
74+
SceneMigrationSynchronization: 1
75+
DontDestroyWithOwner: 0
76+
AutoObjectParentSync: 1
77+
--- !u!114 &3765979716845461206
6578
MonoBehaviour:
6679
m_ObjectHideFlags: 0
6780
m_CorrespondingSourceObject: {fileID: 0}
@@ -70,10 +83,9 @@ MonoBehaviour:
7083
m_GameObject: {fileID: 3765979716845461205}
7184
m_Enabled: 1
7285
m_EditorHideFlags: 0
73-
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
86+
m_Script: {fileID: 11500000, guid: f4506649f88aac74ea839a52818e3174, type: 3}
7487
m_Name:
7588
m_EditorClassIdentifier:
76-
GlobalObjectIdHash: 951099334
77-
AlwaysReplicateAsRoot: 0
78-
DontDestroyWithOwner: 0
79-
AutoObjectParentSync: 1
89+
m_DelayBeforeUnload: 5
90+
m_SceneName:
91+
m_PlayerTag: Player

Assets/Prefabs/DebugCheatsManager.prefab

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ GameObject:
99
serializedVersion: 6
1010
m_Component:
1111
- component: {fileID: 2726635115303138402}
12-
- component: {fileID: 7241368247586282332}
1312
- component: {fileID: 6695920927348029111}
13+
- component: {fileID: 7241368247586282332}
1414
m_Layer: 0
1515
m_Name: DebugCheatsManager
1616
m_TagString: Untagged
@@ -25,15 +25,15 @@ Transform:
2525
m_PrefabInstance: {fileID: 0}
2626
m_PrefabAsset: {fileID: 0}
2727
m_GameObject: {fileID: 776943915682426285}
28+
serializedVersion: 2
2829
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2930
m_LocalPosition: {x: 0, y: 0, z: 0}
3031
m_LocalScale: {x: 1, y: 1, z: 1}
3132
m_ConstrainProportionsScale: 0
3233
m_Children: []
3334
m_Father: {fileID: 0}
34-
m_RootOrder: 0
3535
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
36-
--- !u!114 &7241368247586282332
36+
--- !u!114 &6695920927348029111
3737
MonoBehaviour:
3838
m_ObjectHideFlags: 0
3939
m_CorrespondingSourceObject: {fileID: 0}
@@ -42,14 +42,17 @@ MonoBehaviour:
4242
m_GameObject: {fileID: 776943915682426285}
4343
m_Enabled: 1
4444
m_EditorHideFlags: 0
45-
m_Script: {fileID: 11500000, guid: ab1e76745edfc434ab8154ad27efc5fd, type: 3}
45+
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
4646
m_Name:
4747
m_EditorClassIdentifier:
48-
m_DebugCheatsPanel: {fileID: 0}
49-
m_EnemyPrefab: {fileID: 3713729372785093435, guid: 6cdd52f1fa2ed34469a487ae6477eded, type: 3}
50-
m_BossPrefab: {fileID: 3688950541947916326, guid: 365e94337fd10fe4ebde1906df413ac7, type: 3}
51-
m_OpenWindowKeyCode: 47
52-
--- !u!114 &6695920927348029111
48+
GlobalObjectIdHash: 951099334
49+
AlwaysReplicateAsRoot: 0
50+
SynchronizeTransform: 0
51+
ActiveSceneSynchronization: 0
52+
SceneMigrationSynchronization: 1
53+
DontDestroyWithOwner: 0
54+
AutoObjectParentSync: 1
55+
--- !u!114 &7241368247586282332
5356
MonoBehaviour:
5457
m_ObjectHideFlags: 0
5558
m_CorrespondingSourceObject: {fileID: 0}
@@ -58,13 +61,10 @@ MonoBehaviour:
5861
m_GameObject: {fileID: 776943915682426285}
5962
m_Enabled: 1
6063
m_EditorHideFlags: 0
61-
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
64+
m_Script: {fileID: 11500000, guid: ab1e76745edfc434ab8154ad27efc5fd, type: 3}
6265
m_Name:
6366
m_EditorClassIdentifier:
64-
GlobalObjectIdHash: 951099334
65-
AlwaysReplicateAsRoot: 0
66-
SynchronizeTransform: 0
67-
ActiveSceneSynchronization: 0
68-
SceneMigrationSynchronization: 1
69-
DontDestroyWithOwner: 0
70-
AutoObjectParentSync: 1
67+
m_DebugCheatsPanel: {fileID: 0}
68+
m_EnemyPrefab: {fileID: 3713729372785093435, guid: 6cdd52f1fa2ed34469a487ae6477eded, type: 3}
69+
m_BossPrefab: {fileID: 3688950541947916326, guid: 365e94337fd10fe4ebde1906df413ac7, type: 3}
70+
m_OpenWindowKeyCode: 47

Assets/Prefabs/LoadingProgressTracker.prefab

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ GameObject:
99
serializedVersion: 6
1010
m_Component:
1111
- component: {fileID: 3106828016798330215}
12-
- component: {fileID: 3106828016798330208}
1312
- component: {fileID: 3106828016798330209}
13+
- component: {fileID: 3106828016798330208}
1414
m_Layer: 0
1515
m_Name: LoadingProgressTracker
1616
m_TagString: Untagged
@@ -25,15 +25,15 @@ Transform:
2525
m_PrefabInstance: {fileID: 0}
2626
m_PrefabAsset: {fileID: 0}
2727
m_GameObject: {fileID: 3106828016798330210}
28+
serializedVersion: 2
2829
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2930
m_LocalPosition: {x: 0, y: 0, z: 0}
3031
m_LocalScale: {x: 1, y: 1, z: 1}
3132
m_ConstrainProportionsScale: 0
3233
m_Children: []
3334
m_Father: {fileID: 0}
34-
m_RootOrder: 0
3535
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
36-
--- !u!114 &3106828016798330208
36+
--- !u!114 &3106828016798330209
3737
MonoBehaviour:
3838
m_ObjectHideFlags: 0
3939
m_CorrespondingSourceObject: {fileID: 0}
@@ -42,10 +42,17 @@ MonoBehaviour:
4242
m_GameObject: {fileID: 3106828016798330210}
4343
m_Enabled: 1
4444
m_EditorHideFlags: 0
45-
m_Script: {fileID: 11500000, guid: 8e20ce98a70947b68f7982c1c417f88c, type: 3}
45+
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
4646
m_Name:
4747
m_EditorClassIdentifier:
48-
--- !u!114 &3106828016798330209
48+
GlobalObjectIdHash: 951099334
49+
AlwaysReplicateAsRoot: 0
50+
SynchronizeTransform: 0
51+
ActiveSceneSynchronization: 0
52+
SceneMigrationSynchronization: 1
53+
DontDestroyWithOwner: 0
54+
AutoObjectParentSync: 1
55+
--- !u!114 &3106828016798330208
4956
MonoBehaviour:
5057
m_ObjectHideFlags: 0
5158
m_CorrespondingSourceObject: {fileID: 0}
@@ -54,13 +61,6 @@ MonoBehaviour:
5461
m_GameObject: {fileID: 3106828016798330210}
5562
m_Enabled: 1
5663
m_EditorHideFlags: 0
57-
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
64+
m_Script: {fileID: 11500000, guid: 8e20ce98a70947b68f7982c1c417f88c, type: 3}
5865
m_Name:
5966
m_EditorClassIdentifier:
60-
GlobalObjectIdHash: 951099334
61-
AlwaysReplicateAsRoot: 0
62-
SynchronizeTransform: 0
63-
ActiveSceneSynchronization: 0
64-
SceneMigrationSynchronization: 1
65-
DontDestroyWithOwner: 0
66-
AutoObjectParentSync: 1

Assets/Prefabs/NetworkObjectPool.prefab

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ GameObject:
99
serializedVersion: 6
1010
m_Component:
1111
- component: {fileID: 7944773021007068224}
12-
- component: {fileID: 7944773021007068227}
1312
- component: {fileID: 8707830667181757321}
13+
- component: {fileID: 7944773021007068227}
1414
m_Layer: 0
1515
m_Name: NetworkObjectPool
1616
m_TagString: Untagged
@@ -25,14 +25,33 @@ Transform:
2525
m_PrefabInstance: {fileID: 0}
2626
m_PrefabAsset: {fileID: 0}
2727
m_GameObject: {fileID: 7944773021007068226}
28+
serializedVersion: 2
2829
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2930
m_LocalPosition: {x: 0, y: 0, z: 0}
3031
m_LocalScale: {x: 1, y: 1, z: 1}
3132
m_ConstrainProportionsScale: 0
3233
m_Children: []
3334
m_Father: {fileID: 0}
34-
m_RootOrder: 0
3535
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
36+
--- !u!114 &8707830667181757321
37+
MonoBehaviour:
38+
m_ObjectHideFlags: 0
39+
m_CorrespondingSourceObject: {fileID: 0}
40+
m_PrefabInstance: {fileID: 0}
41+
m_PrefabAsset: {fileID: 0}
42+
m_GameObject: {fileID: 7944773021007068226}
43+
m_Enabled: 1
44+
m_EditorHideFlags: 0
45+
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
46+
m_Name:
47+
m_EditorClassIdentifier:
48+
GlobalObjectIdHash: 951099334
49+
AlwaysReplicateAsRoot: 0
50+
SynchronizeTransform: 0
51+
ActiveSceneSynchronization: 0
52+
SceneMigrationSynchronization: 1
53+
DontDestroyWithOwner: 0
54+
AutoObjectParentSync: 1
3655
--- !u!114 &7944773021007068227
3756
MonoBehaviour:
3857
m_ObjectHideFlags: 0
@@ -56,22 +75,3 @@ MonoBehaviour:
5675
PrewarmCount: 5
5776
- Prefab: {fileID: 5473352307376472481, guid: 3e5c32e5766633a4eaf9e7c393418b34, type: 3}
5877
PrewarmCount: 5
59-
--- !u!114 &8707830667181757321
60-
MonoBehaviour:
61-
m_ObjectHideFlags: 0
62-
m_CorrespondingSourceObject: {fileID: 0}
63-
m_PrefabInstance: {fileID: 0}
64-
m_PrefabAsset: {fileID: 0}
65-
m_GameObject: {fileID: 7944773021007068226}
66-
m_Enabled: 1
67-
m_EditorHideFlags: 0
68-
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
69-
m_Name:
70-
m_EditorClassIdentifier:
71-
GlobalObjectIdHash: 951099334
72-
AlwaysReplicateAsRoot: 0
73-
SynchronizeTransform: 0
74-
ActiveSceneSynchronization: 0
75-
SceneMigrationSynchronization: 1
76-
DontDestroyWithOwner: 0
77-
AutoObjectParentSync: 1

Assets/Prefabs/SceneLoader.prefab

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ GameObject:
99
serializedVersion: 6
1010
m_Component:
1111
- component: {fileID: 7533068275093218427}
12-
- component: {fileID: 2071498811241465156}
1312
- component: {fileID: 8734696198808489477}
13+
- component: {fileID: 2071498811241465156}
1414
- component: {fileID: 6240023712540756099}
1515
m_Layer: 0
1616
m_Name: SceneLoader
@@ -26,15 +26,15 @@ Transform:
2626
m_PrefabInstance: {fileID: 0}
2727
m_PrefabAsset: {fileID: 0}
2828
m_GameObject: {fileID: 5970766024194302363}
29+
serializedVersion: 2
2930
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
3031
m_LocalPosition: {x: 0, y: 0, z: 0}
3132
m_LocalScale: {x: 1, y: 1, z: 1}
3233
m_ConstrainProportionsScale: 0
3334
m_Children: []
3435
m_Father: {fileID: 0}
35-
m_RootOrder: 0
3636
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
37-
--- !u!114 &2071498811241465156
37+
--- !u!114 &8734696198808489477
3838
MonoBehaviour:
3939
m_ObjectHideFlags: 0
4040
m_CorrespondingSourceObject: {fileID: 0}
@@ -43,12 +43,17 @@ MonoBehaviour:
4343
m_GameObject: {fileID: 5970766024194302363}
4444
m_Enabled: 1
4545
m_EditorHideFlags: 0
46-
m_Script: {fileID: 11500000, guid: d202c9ed4a2c4a6fa83f21f1c21394ea, type: 3}
46+
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
4747
m_Name:
4848
m_EditorClassIdentifier:
49-
m_ClientLoadingScreen: {fileID: 0}
50-
m_LoadingProgressManager: {fileID: 6240023712540756099}
51-
--- !u!114 &8734696198808489477
49+
GlobalObjectIdHash: 951099334
50+
AlwaysReplicateAsRoot: 0
51+
SynchronizeTransform: 0
52+
ActiveSceneSynchronization: 0
53+
SceneMigrationSynchronization: 1
54+
DontDestroyWithOwner: 0
55+
AutoObjectParentSync: 1
56+
--- !u!114 &2071498811241465156
5257
MonoBehaviour:
5358
m_ObjectHideFlags: 0
5459
m_CorrespondingSourceObject: {fileID: 0}
@@ -57,16 +62,11 @@ MonoBehaviour:
5762
m_GameObject: {fileID: 5970766024194302363}
5863
m_Enabled: 1
5964
m_EditorHideFlags: 0
60-
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
65+
m_Script: {fileID: 11500000, guid: d202c9ed4a2c4a6fa83f21f1c21394ea, type: 3}
6166
m_Name:
6267
m_EditorClassIdentifier:
63-
GlobalObjectIdHash: 951099334
64-
AlwaysReplicateAsRoot: 0
65-
SynchronizeTransform: 0
66-
ActiveSceneSynchronization: 0
67-
SceneMigrationSynchronization: 1
68-
DontDestroyWithOwner: 0
69-
AutoObjectParentSync: 1
68+
m_ClientLoadingScreen: {fileID: 0}
69+
m_LoadingProgressManager: {fileID: 6240023712540756099}
7070
--- !u!114 &6240023712540756099
7171
MonoBehaviour:
7272
m_ObjectHideFlags: 0

Assets/Scenes/Startup.unity

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:23e64f176df19566b90ab728417990e715e937d86d6499e1b1d537c39e9fe63a
3-
size 52979
2+
oid sha256:daaa3847b041faeb0af9f4962967b3883af1a3f20ca0ad4dd9b7e2f07c2fc0e3
3+
size 59280

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1919

2020
### Fixed
2121
* Fixed colliders on diagonal walls to not have negative scale (#854).
22+
* 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.
2223
* Unnecessary update requests are no longer being sent to Lobby after receiving update events from the service (#860).
2324
* Fixed a condition where one would be unable to quit the application through OS-level quit button, nor the in-game quit button (#863)
2425

0 commit comments

Comments
 (0)