File tree Expand file tree Collapse file tree 2 files changed +3
-18
lines changed
com.unity.netcode.gameobjects Expand file tree Collapse file tree 2 files changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -19,25 +19,13 @@ public sealed class NetworkObject : MonoBehaviour
19
19
internal uint GlobalObjectIdHash ;
20
20
21
21
#if UNITY_EDITOR
22
- // HEAD: DO NOT USE! TEST ONLY TEMP IMPL, WILL BE REMOVED
23
- internal uint TempGlobalObjectIdHashOverride = 0 ;
24
- // TAIL: DO NOT USE! TEST ONLY TEMP IMPL, WILL BE REMOVED
25
-
26
22
private void OnValidate ( )
27
23
{
28
24
GenerateGlobalObjectIdHash ( ) ;
29
25
}
30
26
31
27
internal void GenerateGlobalObjectIdHash ( )
32
28
{
33
- // HEAD: DO NOT USE! TEST ONLY TEMP IMPL, WILL BE REMOVED
34
- if ( TempGlobalObjectIdHashOverride != 0 )
35
- {
36
- GlobalObjectIdHash = TempGlobalObjectIdHashOverride ;
37
- return ;
38
- }
39
- // TAIL: DO NOT USE! TEST ONLY TEMP IMPL, WILL BE REMOVED
40
-
41
29
// do NOT regenerate GlobalObjectIdHash for NetworkPrefabs while Editor is in PlayMode
42
30
if ( UnityEditor . EditorApplication . isPlaying && ! string . IsNullOrEmpty ( gameObject . scene . name ) )
43
31
{
Original file line number Diff line number Diff line change @@ -217,16 +217,13 @@ public class CoroutineResultWrapper<T>
217
217
/// <param name="globalObjectIdHash">The GlobalObjectId to force</param>
218
218
public static void MakeNetworkObjectTestPrefab ( NetworkObject networkObject , uint globalObjectIdHash = default )
219
219
{
220
- // Set a globalObjectId for prefab
220
+ // Override `GlobalObjectIdHash` if `globalObjectIdHash` param is set
221
221
if ( globalObjectIdHash != default )
222
222
{
223
- networkObject . TempGlobalObjectIdHashOverride = globalObjectIdHash ;
223
+ networkObject . GlobalObjectIdHash = globalObjectIdHash ;
224
224
}
225
225
226
- // Force generation
227
- networkObject . GenerateGlobalObjectIdHash ( ) ;
228
-
229
- // Fallback to auto-increment if generation fails
226
+ // Fallback to auto-increment if `GlobalObjectIdHash` was never set
230
227
if ( networkObject . GlobalObjectIdHash == default )
231
228
{
232
229
networkObject . GlobalObjectIdHash = ++ s_AutoIncrementGlobalObjectIdHashCounter ;
You can’t perform that action at this time.
0 commit comments