Skip to content

Commit a7c8e62

Browse files
chore: move the timing types to Unity.Netcode.GameObjects.Timing
Runtime/Timing moves out of the Unity.Netcode root so that correcting the casing of Netcode for Entities' Unity.NetCode namespace does not collide with it. Two of the names are the collision: NetworkTime and NetworkTimeSystem exist in both SDKs as unrelated types - a time value here, an IComponentData carrying prediction-loop state there - and two assemblies exporting one fully qualified name is CS0433, which no user can work around in source. The three public types carry [MovedFrom(true, "Unity.Netcode", null, null)], so existing scripts are rewritten on upgrade. sourceAssembly is null because Unity.Netcode.Runtime keeps its name and a null argument is read as "unchanged"; the editor relocation passed an assembly name because that one genuinely moved assemblies. The three internal types in the folder carry nothing - the attribute only matters for API the updater has to migrate. Consumers take an import rather than a qualified name at each site. Qualification was the first approach and it is wrong here: .editorconfig sets IDE0001 to error, so a fully qualified name that the simplifier can shorten fails the Standards job. That leaves NGO's own references reading the bare name, which is correct as long as nothing else occupies Unity.Netcode.NetworkTime - if Netcode for Entities takes those names without vacating them, this assembly stops compiling wherever both packages are installed. That is deliberate: it fails early and loudly in our own CI rather than silently in user projects, and the recommendation both halves of this work rest on is that neither SDK keeps those names in the shared root. Files whose declared namespace is exactly Unity.Netcode cannot use an import for the two colliding names at all - the enclosing namespace's members beat both using directives and using aliases (CS0576) - so if the one-sided case ever has to be supported, those five files need qualified names and the rest do not. Sub-namespaces such as Unity.Netcode.Components never walk that far up and are fine either way. NetworkTimeSystem and AnticipationSystem now import Unity.Netcode themselves, and the five Components.NetworkTransform doc references in NetworkTimeSystem are spelled in full, since that prefix was only reachable from inside the root namespace. Compile-checked: runtime (with and without UNITY_EDITOR), editor, runtime tests and editor tests all clean, the last except the known environmental CS0656 on BytePackerTests. The UNIFIED_NETCODE path is not covered - the harness has no Entities or NetCode references - so UnifiedNetcodeTransport was checked by reading it: IRealTimeProvider at line 207 is a type position, so its import is needed.
1 parent 58dc11e commit a7c8e62

30 files changed

Lines changed: 48 additions & 11 deletions

‎com.unity.netcode.gameobjects/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Additional documentation and release notes are available at [Multiplayer Documen
1717
- `Unity.Netcode.Editor.CodeGen` → `Unity.Netcode.GameObjects.Editor.CodeGen`
1818
- `Unity.Netcode.Editor.PackageChecker` → `Unity.Netcode.GameObjects.Editor.PackageChecker`
1919
- `Unity.Netcode.Editor.Tests` → `Unity.Netcode.GameObjects.Editor.Tests`
20+
- The timing types moved out of the `Unity.Netcode` namespace into `Unity.Netcode.GameObjects.Timing`. The assembly is unchanged, and existing scripts are migrated automatically when the package is upgraded.
21+
- `Unity.Netcode.NetworkTime` → `Unity.Netcode.GameObjects.Timing.NetworkTime`
22+
- `Unity.Netcode.NetworkTimeSystem` → `Unity.Netcode.GameObjects.Timing.NetworkTimeSystem`
23+
- `Unity.Netcode.NetworkTickSystem` → `Unity.Netcode.GameObjects.Timing.NetworkTickSystem`
2024

2125
### Deprecated
2226

‎com.unity.netcode.gameobjects/Runtime/Components/AnticipatedNetworkTransform.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Unity.Mathematics;
2+
using Unity.Netcode.GameObjects.Timing;
23
using Unity.Netcode.Runtime;
34
using UnityEngine;
45

‎com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Runtime.CompilerServices;
4+
using Unity.Netcode.GameObjects.Timing;
45
using UnityEngine;
56

67
namespace Unity.Netcode

‎com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Runtime.CompilerServices;
44
using System.Text;
55
using Unity.Mathematics;
6+
using Unity.Netcode.GameObjects.Timing;
67
using Unity.Netcode.Runtime;
78
using UnityEngine;
89

‎com.unity.netcode.gameobjects/Runtime/Core/ComponentFactory.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using Unity.Netcode.GameObjects.Timing;
34

45
namespace Unity.Netcode
56
{

‎com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Unity.NetCode;
88
#endif
99
using Unity.Netcode.Components;
10+
using Unity.Netcode.GameObjects.Timing;
1011
using Unity.Netcode.Logging;
1112
using Unity.Netcode.Runtime;
1213
// TODO-UNIFIED: When:

‎com.unity.netcode.gameobjects/Runtime/Messaging/Messages/ConnectionApprovedMessage.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using Unity.Collections;
3+
using Unity.Netcode.GameObjects.Timing;
34

45
namespace Unity.Netcode
56
{

‎com.unity.netcode.gameobjects/Runtime/Messaging/Messages/TimeSyncMessage.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Unity.Netcode.GameObjects.Timing;
2+
13
namespace Unity.Netcode
24
{
35
internal struct TimeSyncMessage : INetworkMessage, INetworkSerializeByMemcpy

‎com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using Unity.Mathematics;
3+
using Unity.Netcode.GameObjects.Timing;
34
using UnityEngine;
45

56
namespace Unity.Netcode

‎com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Runtime.CompilerServices;
44
using Unity.Collections;
5+
using Unity.Netcode.GameObjects.Timing;
56

67
namespace Unity.Netcode
78
{

0 commit comments

Comments
 (0)