Commit a7c8e62
committed
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
File tree
- com.unity.netcode.gameobjects
- Runtime
- Components
- Interpolator
- Core
- Messaging/Messages
- NetworkVariable
- Collections
- Spawning
- Timing
- Transports
- UTP
- Unified
- Tests
- Editor
- Timing
- Runtime
- TestHelpers
- Timing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
0 commit comments