diff --git a/.yamato/project.metafile b/.yamato/project.metafile index 8c5b02077d..6abf488f25 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -177,14 +177,14 @@ test_platforms: validation_editors: default: - - 6000.7 + - trunk all: - 6000.7.0a6 - 6000.7 - trunk - 1d47644d0e359a8139ae6f99217da3c4e47f4779 minimal: - - 6000.7.0a6 + - trunk pinnedTrunk: 1d47644d0e359a8139ae6f99217da3c4e47f4779 diff --git a/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs index 2d3c7baafe..00756f0f1a 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; #if UNIFIED_NETCODE -using Unity.NetCode; -using Unity.NetCode.Editor; +using Unity.Netcode.Editor; #endif using UnityEditor; using UnityEngine; @@ -42,10 +41,15 @@ private static void OnApplicationStart() /// The with the component being removed. private static void OnGhostObjectPreRemoval(GameObject gameObject) { - var ghostBehaviours = gameObject.GetComponentsInChildren(); - for (int i = ghostBehaviours.Length - 1; i >= 0; i--) + // GhostBehaviour is internal to N4E and its IVT grant to this assembly differs between N4E's editor-bundled and standalone builds, so resolve it via reflection to stay build-agnostic. + var ghostBehaviourType = typeof(NetcodeWorld).Assembly.GetType("Unity.Netcode.GhostBehaviour"); + if (ghostBehaviourType != null) { - DestroyImmediate(ghostBehaviours[i], true); + var ghostBehaviours = gameObject.GetComponentsInChildren(ghostBehaviourType); + for (int i = ghostBehaviours.Length - 1; i >= 0; i--) + { + DestroyImmediate(ghostBehaviours[i], true); + } } var networkObject = gameObject.GetComponent(); networkObject.GhostObject = null; diff --git a/com.unity.netcode.gameobjects/Runtime/Components/AnticipatedNetworkTransform.cs b/com.unity.netcode.gameobjects/Runtime/Components/AnticipatedNetworkTransform.cs index 26d1e939e2..55898ac31c 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/AnticipatedNetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/AnticipatedNetworkTransform.cs @@ -21,13 +21,13 @@ namespace Unity.Netcode.Components /// resulting in a "snap" to the new value if it is different from the anticipated value. /// /// Smooth: In this mode (with set to - /// and an callback that calls + /// and an callback that calls /// from the anticipated value to the authority value with an appropriate /// -style smooth function), when a more up-to-date value is received from the authority, /// it will interpolate over time from an incorrect anticipated value to the correct authoritative value. /// /// Constant Reanticipation: In this mode (with set to - /// and an that calculates a + /// and an that calculates a /// new anticipated value based on the current authoritative value), when a more up-to-date value is received from /// the authority, user code calculates a new anticipated value, possibly calling to interpolate /// between the previous anticipation and the new anticipation. This is useful for values that change frequently and @@ -101,11 +101,11 @@ private void Reset() /// Defines what the behavior should be if we receive a value from the server with an earlier associated /// time value than the anticipation time value. ///

- /// If this is , the stale data will be ignored and the authoritative + /// If this is , the stale data will be ignored and the authoritative /// value will not replace the anticipated value until the anticipation time is reached. /// and will also not be invoked for this stale data. ///

- /// If this is , the stale data will replace the anticipated data and + /// If this is , the stale data will replace the anticipated data and /// and will be invoked. /// In this case, the authoritativeTime value passed to will be lower than /// the anticipationTime value, and that callback can be used to calculate a new anticipated value. diff --git a/com.unity.netcode.gameobjects/Runtime/Components/Helpers/NetworkObjectBridge.cs b/com.unity.netcode.gameobjects/Runtime/Components/Helpers/NetworkObjectBridge.cs index 69eb729d9a..1217f6ba31 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/Helpers/NetworkObjectBridge.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/Helpers/NetworkObjectBridge.cs @@ -1,5 +1,5 @@ #if UNIFIED_NETCODE -using Unity.NetCode; +using Unity.Transforms; using UnityEngine; namespace Unity.Netcode @@ -13,7 +13,7 @@ namespace Unity.Netcode [DefaultExecutionOrder(GhostObject.ExecutionOrder + 1)] //BREAK --- Fix this on UNIFIED side 1st - public partial class NetworkObjectBridge : GhostBehaviour + internal partial class NetworkObjectBridge : GhostBehaviour { // DefaultExecutionOrder // TODO: Define a const for the value used on GhostObject and use that value @@ -83,5 +83,32 @@ internal void ApplyScale(Vector3 scale) Ghost.ApplyPostTransformMatrixScale(scale); } } + + /// + /// Replaces the N4E GhostObject.ApplyPostTransformMatrixScale helper that was removed by the 6.7.0 + /// PostTransformMatrix scale rework, keeping NGO's hybrid parenting scale path working without an N4E change. + /// + internal static class GhostObjectScaleExtensions + { + internal static void ApplyPostTransformMatrixScale(this GhostObject ghost, Vector3 scale) + { + var entityManager = ghost.World.EntityManager; + var entity = ghost.Entity; + if (entityManager.HasComponent(entity)) + { + entityManager.SetComponentData(entity, new PostTransformMatrix { Value = Mathematics.float4x4.Scale(scale) }); + } + else if (Mathf.Approximately(scale.x, scale.y) && Mathf.Approximately(scale.y, scale.z)) + { + var localTransform = entityManager.GetComponentData(entity); + localTransform.Scale = scale.x; + entityManager.SetComponentData(entity, localTransform); + } + else + { + entityManager.AddComponentData(entity, new PostTransformMatrix { Value = Mathematics.float4x4.Scale(scale) }); + } + } + } } #endif diff --git a/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs b/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs index 8b99dce5aa..f87cbd3425 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs @@ -1,7 +1,6 @@ #if UNIFIED_NETCODE using System; using Unity.Entities; -using Unity.NetCode; using UnityEngine; namespace Unity.Netcode diff --git a/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedUpdateConnections.cs b/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedUpdateConnections.cs index e9b66ba877..513f84cfc7 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedUpdateConnections.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedUpdateConnections.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using Unity.Collections; using Unity.Entities; -using Unity.NetCode; using UnityEngine; namespace Unity.Netcode.Components diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index b05578fed0..5d1a04537b 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -917,7 +917,7 @@ internal void InternalOnNetworkDespawn() } /// - /// In client-server contexts, this method is invoked on both the server and the local client of the owner when ownership is assigned. + /// In client-server contexts, this method is invoked on both the server and the local client of the owner when ownership is assigned. /// In distributed authority contexts, this method is invoked on all clients connected to the session. /// public virtual void OnGainedOwnership() { } @@ -952,7 +952,7 @@ internal void InternalOnOwnershipChanged(ulong previous, ulong current) } /// - /// In client-server contexts, this method is invoked on the local client when it loses ownership of the associated + /// In client-server contexts, this method is invoked on the local client when it loses ownership of the associated /// and on the server when any client loses ownership. /// In distributed authority contexts, this method is invoked on all clients connected to the session. /// diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs index 3c5600afa5..4d0533dfda 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs @@ -7,8 +7,7 @@ // Netcode for Entities' namespace differs from this one only by the casing of a single letter, so a // blanket import of it competes with Unity.Netcode on every name the two happen to share. Importing // only the types used here keeps that surface to exactly those names. -using NetCodeConfig = Unity.NetCode.NetCodeConfig; -using NetcodeWorld = Unity.NetCode.NetcodeWorld; +using NetCodeConfig = Unity.Netcode.NetcodeConfig; #endif using Unity.Netcode.Components; using Unity.Netcode.GameObjects.Timing; @@ -1375,13 +1374,13 @@ internal void InitializeNetcodeWorld() if (this == Singleton) { - if (NetCode.Netcode.IsActive) + if (Netcode.IsActive) { Log.Info(new Context(LogLevel.Normal, "Netcode is not active but has an instance at this point.")); } /// !! Important !! /// Clear out any pre-existing configuration in the event this applicatioin instance has already been connected to a session. - NetCode.Netcode.Reset(); + Netcode.Reset(); } /// !! Initialize worlds here !! diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index 2ec3eedacf..8d893a78f0 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -8,7 +8,6 @@ using Unity.Netcode.Logging; using Unity.Netcode.Runtime; #if UNIFIED_NETCODE -using Unity.NetCode; #endif #if UNITY_EDITOR diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs index a09314e8cb..1cfab08e12 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs @@ -33,18 +33,18 @@ public enum StaleDataHandling /// /// /// Snap: In this mode (with set to - /// and no callback), + /// and no callback), /// the moment a more up-to-date value is received from the authority, it will simply replace the anticipated value, /// resulting in a "snap" to the new value if it is different from the anticipated value. /// /// Smooth: In this mode (with set to - /// and an callback that calls + /// and an callback that calls /// from the anticipated value to the authority value with an appropriate /// -style smooth function), when a more up-to-date value is received from the authority, /// it will interpolate over time from an incorrect anticipated value to the correct authoritative value. /// /// Constant Reanticipation: In this mode (with set to - /// and an that calculates a + /// and an that calculates a /// new anticipated value based on the current authoritative value), when a more up-to-date value is received from /// the authority, user code calculates a new anticipated value, possibly calling to interpolate /// between the previous anticipation and the new anticipation. This is useful for values that change frequently and @@ -85,11 +85,11 @@ public class AnticipatedNetworkVariable : NetworkVariableBase /// Defines what the behavior should be if we receive a value from the server with an earlier associated /// time value than the anticipation time value. ///

- /// If this is , the stale data will be ignored and the authoritative + /// If this is , the stale data will be ignored and the authoritative /// value will not replace the anticipated value until the anticipation time is reached. /// and will also not be invoked for this stale data. ///

- /// If this is , the stale data will replace the anticipated data and + /// If this is , the stale data will replace the anticipated data and /// and will be invoked. /// In this case, the authoritativeTime value passed to will be lower than /// the anticipationTime value, and that callback can be used to calculate a new anticipated value. @@ -229,7 +229,7 @@ public void Anticipate(T value) /// Retrieves or sets the underlying authoritative value. /// Note that only a client or server with write permissions to this variable may set this value. /// When this variable has been anticipated, this value will alawys return the most recent authoritative - /// state, which is updated even if is . + /// state, which is updated even if is . /// #pragma warning restore IDE0001 public T AuthoritativeValue diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs index 8ee61a95ab..cafce0f7c1 100644 --- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs @@ -23,7 +23,7 @@ public class SceneEvent { /// /// The returned by
- /// This is set for the following s: + /// This is set for the following s: /// /// /// @@ -32,13 +32,13 @@ public class SceneEvent public AsyncOperation AsyncOperation; /// - /// Will always be set to the current + /// Will always be set to the current /// public SceneEventType SceneEventType; /// /// If applicable, this reflects the type of scene loading or unloading that is occurring.
- /// This is set for the following s: + /// This is set for the following s: /// /// /// @@ -52,7 +52,7 @@ public class SceneEvent /// /// This will be set to the scene name that the event pertains to.
- /// This is set for the following s: + /// This is set for the following s: /// /// /// @@ -66,7 +66,7 @@ public class SceneEvent /// /// This will be set to the path to the scene that the event pertains to.
- /// This is set for the following s: + /// This is set for the following s: /// /// /// @@ -80,7 +80,7 @@ public class SceneEvent /// /// When a scene is loaded, the Scene structure is returned.
- /// This is set for the following s: + /// This is set for the following s: /// /// /// @@ -90,7 +90,7 @@ public class SceneEvent /// /// The client identifier can vary depending upon the following conditions:
/// - /// s that always set the + /// s that always set the /// to the local client identifier, are initiated (and processed locally) by the /// server-host, and sent to all clients to be processed.
/// @@ -122,7 +122,7 @@ public class SceneEvent /// /// List of clients that completed a loading or unloading event.
- /// This is set for the following s: + /// This is set for the following s: /// /// /// @@ -132,7 +132,7 @@ public class SceneEvent /// /// List of clients that timed out during a loading or unloading event.
- /// This is set for the following s: + /// This is set for the following s: /// /// /// @@ -824,7 +824,7 @@ public void SetClientSynchronizationMode(LoadSceneMode mode) /// /// Constructor /// - /// one instance per instance + /// one instance per instance /// maximum pool size internal NetworkSceneManager(NetworkManager networkManager) { @@ -2693,7 +2693,7 @@ internal void HandleSceneEvent(ulong clientId, FastBufferReader reader) } else { - Debug.LogError($"{nameof(HandleSceneEvent)} was invoked but {nameof(Netcode.NetworkManager)} reference was null!"); + Debug.LogError($"{nameof(HandleSceneEvent)} was invoked but {nameof(NetworkManager)} reference was null!"); } } diff --git a/com.unity.netcode.gameobjects/Runtime/Spawning/GhostSpawnManager.cs b/com.unity.netcode.gameobjects/Runtime/Spawning/GhostSpawnManager.cs index ed6b512494..268bff35e5 100644 --- a/com.unity.netcode.gameobjects/Runtime/Spawning/GhostSpawnManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Spawning/GhostSpawnManager.cs @@ -182,13 +182,13 @@ internal void ProcessAllGhostsPendingSynchronization() m_GhostSynchronizationPendingRemoval.Add(networkObjectId); } else - if ((ghost.Value.RegistrationTime + spawnTimeout) < Time.realtimeSinceStartup) - { - m_Log.Info(new Context(LogLevel.Developer, $"Registering {nameof(NetworkObject.SerializedObject)} for pending synchronization").AddInfo(nameof(NetworkObject.NetworkObjectId), networkObjectId)); + if ((ghost.Value.RegistrationTime + spawnTimeout) < Time.realtimeSinceStartup) + { + m_Log.Info(new Context(LogLevel.Developer, $"Registering {nameof(NetworkObject.SerializedObject)} for pending synchronization").AddInfo(nameof(NetworkObject.NetworkObjectId), networkObjectId)); - // Timed out entries are removed too - m_GhostSynchronizationPendingRemoval.Add(ghost.Key); - } + // Timed out entries are removed too + m_GhostSynchronizationPendingRemoval.Add(ghost.Key); + } } foreach (var networkObjectId in m_GhostSynchronizationPendingRemoval) diff --git a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs index 7b902a3a52..e4c69bfdad 100644 --- a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs +++ b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; #if UNIFIED_NETCODE -using Unity.NetCode; #endif using UnityEngine; diff --git a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs index 28803104f4..8751174403 100644 --- a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs @@ -981,27 +981,27 @@ internal NetworkObject CreateLocalNetworkObject(NetworkObject.SerializedObject s } else #endif - // If scene management is disabled or the NetworkObject was dynamically spawned - if (!NetworkManager.NetworkConfig.EnableSceneManagement || !serializedObject.IsSceneObject) - { - networkObject = GetNetworkObjectToSpawn(serializedObject.Hash, serializedObject.OwnerClientId, position, rotation, serializedObject.IsSceneObject, instantiationData); - } - else // Get the in-scene placed NetworkObject - { - networkObject = NetworkManager.SceneManager.GetSceneRelativeInSceneNetworkObject(globalObjectIdHash, serializedObject.NetworkSceneHandle); - if (networkObject == null) + // If scene management is disabled or the NetworkObject was dynamically spawned + if (!NetworkManager.NetworkConfig.EnableSceneManagement || !serializedObject.IsSceneObject) { - NetworkLog.LogErrorServer(new Context(LogLevel.Error, $"{nameof(NetworkPrefab)} hash was not found! In-Scene placed {nameof(NetworkObject)} soft synchronization failure!").AddInfo(nameof(NetworkObject.GlobalObjectIdHash), globalObjectIdHash)); - return null; + networkObject = GetNetworkObjectToSpawn(serializedObject.Hash, serializedObject.OwnerClientId, position, rotation, serializedObject.IsSceneObject, instantiationData); } - - // Since this NetworkObject is an in-scene placed NetworkObject, if it is disabled then enable it so - // NetworkBehaviours will have their OnNetworkSpawn method invoked - if (!networkObject.gameObject.activeInHierarchy) + else // Get the in-scene placed NetworkObject { - networkObject.gameObject.SetActive(true); + networkObject = NetworkManager.SceneManager.GetSceneRelativeInSceneNetworkObject(globalObjectIdHash, serializedObject.NetworkSceneHandle); + if (networkObject == null) + { + NetworkLog.LogErrorServer(new Context(LogLevel.Error, $"{nameof(NetworkPrefab)} hash was not found! In-Scene placed {nameof(NetworkObject)} soft synchronization failure!").AddInfo(nameof(NetworkObject.GlobalObjectIdHash), globalObjectIdHash)); + return null; + } + + // Since this NetworkObject is an in-scene placed NetworkObject, if it is disabled then enable it so + // NetworkBehaviours will have their OnNetworkSpawn method invoked + if (!networkObject.gameObject.activeInHierarchy) + { + networkObject.gameObject.SetActive(true); + } } - } if (networkObject == null) { return null; diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/Unified/UnifiedNetcodeTransport.cs b/com.unity.netcode.gameobjects/Runtime/Transports/Unified/UnifiedNetcodeTransport.cs index c9fda0cd31..ab8452fb52 100644 --- a/com.unity.netcode.gameobjects/Runtime/Transports/Unified/UnifiedNetcodeTransport.cs +++ b/com.unity.netcode.gameobjects/Runtime/Transports/Unified/UnifiedNetcodeTransport.cs @@ -6,7 +6,6 @@ using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using Unity.Entities; -using Unity.NetCode; using Unity.Netcode.GameObjects.Timing; using Unity.Netcode.Transports.UTP; using UnityEngine; @@ -165,7 +164,7 @@ protected override void OnUpdate() NetworkManager.MessageManager.ProcessSendQueues(); using var commandBuffer = new EntityCommandBuffer(Allocator.Temp); - foreach(var (networkId, _, entity) in SystemAPI.Query, RefRO>().WithEntityAccess()) + foreach (var (networkId, _, entity) in SystemAPI.Query, RefRO>().WithEntityAccess()) { var connectionId = networkId.ValueRO.Value; DynamicBuffer rpcs = EntityManager.GetBuffer(entity); @@ -176,7 +175,7 @@ protected override void OnUpdate() { Transport.DispatchMessage(connectionId, buffer); } - catch(Exception e) + catch (Exception e) { Debug.LogException(e); } @@ -273,7 +272,7 @@ public override NetworkEvent PollEvent(out ulong clientId, out ArraySegment(connection.ConnectionEntity); } - private void OnServerNewClientConnection(Connection connection, NetCodeConnectionEvent connectionEvent) + private void OnServerNewClientConnection(Connection connection, NetcodeConnectionEvent connectionEvent) { m_Connections[connectionEvent.Id.Value] = new ConnectionInfo { @@ -365,7 +364,7 @@ private DisconnectEvents GetDisconnectEventFromNetworkStreamDisconnectReason(Net return DisconnectEvents.Disconnected; } - private void OnClientDisconnectFromServer(Connection connection, NetCodeConnectionEvent connectionEvent) + private void OnClientDisconnectFromServer(Connection connection, NetcodeConnectionEvent connectionEvent) { SetDisconnectEvent( GetDisconnectEventFromNetworkStreamDisconnectReason(connectionEvent.DisconnectReason), @@ -374,12 +373,12 @@ private void OnClientDisconnectFromServer(Connection connection, NetCodeConnecti InvokeOnTransportEvent(NetworkEvent.Disconnect, (ulong)connectionEvent.Id.Value, default, m_RealTimeProvider.RealTimeSinceStartup); } - private void OnServerClientDisconnected(Connection connection, NetCodeConnectionEvent connectionEvent) + private void OnServerClientDisconnected(Connection connection, NetcodeConnectionEvent connectionEvent) { InvokeOnTransportEvent(NetworkEvent.Disconnect, (ulong)connectionEvent.Id.Value, default, m_RealTimeProvider.RealTimeSinceStartup); } - private void OnClientConnectionEvent(Connection connection, NetCodeConnectionEvent connectionEvent) + private void OnClientConnectionEvent(Connection connection, NetcodeConnectionEvent connectionEvent) { switch (connectionEvent.State) { @@ -392,7 +391,7 @@ private void OnClientConnectionEvent(Connection connection, NetCodeConnectionEve } } - private void OnServerConnectionEvent(Connection connection, NetCodeConnectionEvent connectionEvent) + private void OnServerConnectionEvent(Connection connection, NetcodeConnectionEvent connectionEvent) { switch (connectionEvent.State) { diff --git a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef index 6b32d4a1b2..f513e647d2 100644 --- a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef +++ b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef @@ -15,7 +15,8 @@ "Unity.Burst", "Unity.Mathematics", "GUID:953adc2a6b8b4e3c8df5b728bcd546e9", - "Unity.Entities" + "Unity.Entities", + "Unity.Transforms" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/com.unity.netcode.gameobjects/Tests/Editor/Transports/UnityTransportTests.cs b/com.unity.netcode.gameobjects/Tests/Editor/Transports/UnityTransportTests.cs index 22e075eec1..eaf367e066 100644 --- a/com.unity.netcode.gameobjects/Tests/Editor/Transports/UnityTransportTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Editor/Transports/UnityTransportTests.cs @@ -231,7 +231,7 @@ public void UnityTransport_HostnameValidation((string, bool) testCase) } #endif - private class IPCDriverConstructor : INetworkStreamDriverConstructor + private class IPCDriverConstructor : Transports.UTP.INetworkStreamDriverConstructor { public void CreateDriver( UnityTransport transport, diff --git a/com.unity.netcode.gameobjects/Tests/Editor/Unity.Netcode.Editor.Tests.asmdef b/com.unity.netcode.gameobjects/Tests/Editor/Unity.Netcode.Editor.Tests.asmdef index a9a05da02b..c56c041e1e 100644 --- a/com.unity.netcode.gameobjects/Tests/Editor/Unity.Netcode.Editor.Tests.asmdef +++ b/com.unity.netcode.gameobjects/Tests/Editor/Unity.Netcode.Editor.Tests.asmdef @@ -5,6 +5,7 @@ "Unity.Collections", "Unity.Netcode.Runtime", "Unity.Netcode.GameObjects.Editor", + "GUID:953adc2a6b8b4e3c8df5b728bcd546e9", "Unity.Multiplayer.MetricTypes", "Unity.Multiplayer.NetStats", "Unity.Multiplayer.Tools.MetricTypes", diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkBehaviourReferenceTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkBehaviourReferenceTests.cs index 1306b4a803..9248ed159f 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkBehaviourReferenceTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkBehaviourReferenceTests.cs @@ -57,6 +57,9 @@ public IEnumerator TestRpcImplicitNetworkBehaviour() #region Tests using non-null NetworkBehaviours and NetworkVariable [UnityTest] +#if ENABLE_CORECLR + [Explicit("NGO NetworkVariable serialization codegen not generated for some types on CoreCLR (falls back to FallbackSerializer), see https://jira.unity3d.com/browse/UUM-149592")] +#endif public IEnumerator TestNetworkVariable() { yield return SpawnTestPrefabInstance(); @@ -75,6 +78,9 @@ public IEnumerator TestNetworkVariable() #region Validating using NULL as a NetworkBehaviourReference [UnityTest] +#if ENABLE_CORECLR + [Explicit("NGO NetworkVariable serialization codegen not generated for some types on CoreCLR (falls back to FallbackSerializer), see https://jira.unity3d.com/browse/UUM-149592")] +#endif public IEnumerator TestSerializeNull() { yield return SpawnTestPrefabInstance(true); diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkObjectReferenceTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkObjectReferenceTests.cs index 139a4a9e4f..8d6122a27b 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkObjectReferenceTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Serialization/NetworkObjectReferenceTests.cs @@ -34,6 +34,9 @@ protected override void OnOneTimeSetup() } [UnityTest] +#if ENABLE_CORECLR + [Explicit("NGO NetworkVariable serialization codegen not generated for some types on CoreCLR (falls back to FallbackSerializer), see https://jira.unity3d.com/browse/UUM-149592")] +#endif public IEnumerator TestSerializeNetworkObject() { yield return SpawnTestPrefabInstance(); @@ -61,6 +64,9 @@ public IEnumerator TestSerializeNetworkObject() } [UnityTest] +#if ENABLE_CORECLR + [Explicit("NGO NetworkVariable serialization codegen not generated for some types on CoreCLR (falls back to FallbackSerializer), see https://jira.unity3d.com/browse/UUM-149592")] +#endif public IEnumerator TestSerializeNull() { yield return SpawnTestPrefabInstance(true); @@ -108,6 +114,9 @@ public IEnumerator TestSerializeNull() } [UnityTest] +#if ENABLE_CORECLR + [Explicit("NGO NetworkVariable serialization codegen not generated for some types on CoreCLR (falls back to FallbackSerializer), see https://jira.unity3d.com/browse/UUM-149592")] +#endif public IEnumerator TestGetReferenceAndConversion() { yield return SpawnTestPrefabInstance(); diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs b/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs index 6dbf9fe2e1..865dac9a62 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs @@ -7,7 +7,7 @@ using System.Text; using NUnit.Framework; #if UNIFIED_NETCODE -using Unity.NetCode; + #endif using Unity.Netcode.GameObjects.Timing; using Unity.Netcode.RuntimeTests; @@ -2655,7 +2655,7 @@ internal void SpawnInstanceWithOwnership(NetworkObject networkObjectToSpawn, Net // assigning this. if (networkObjectToSpawn.HasGhost) { - NetCode.Netcode.Instance.m_ActiveWorld = m_ServerNetworkManager.NetcodeWorld; + Netcode.Instance.m_ActiveWorld = m_ServerNetworkManager.NetcodeWorld; } #endif networkObjectToSpawn.NetworkManagerOwner = m_ServerNetworkManager; // Required to assure the server does the spawning @@ -2726,7 +2726,7 @@ private GameObject SpawnObject(NetworkObject prefabNetworkObject, NetworkManager // TODO-UNIFIED: NetCode.Netcode.Instance is a singleton and might cause issues assigning this. if (prefabNetworkObject.HasGhost) { - NetCode.Netcode.Instance.m_ActiveWorld = m_ServerNetworkManager.NetcodeWorld; + Netcode.Instance.m_ActiveWorld = m_ServerNetworkManager.NetcodeWorld; } #endif var newInstance = Object.Instantiate(prefabNetworkObject.gameObject); diff --git a/com.unity.netcode.gameobjects/package.json b/com.unity.netcode.gameobjects/package.json index bc60d24511..4c081beac9 100644 --- a/com.unity.netcode.gameobjects/package.json +++ b/com.unity.netcode.gameobjects/package.json @@ -7,7 +7,8 @@ "unityRelease": "0a6", "dependencies": { "com.unity.nuget.mono-cecil": "1.11.4", - "com.unity.transport": "2.6.0" + "com.unity.transport": "6.5.0", + "com.unity.netcode": "7.0.0" }, "samples": [ { diff --git a/testproject/Packages/manifest-unified.json b/testproject/Packages/manifest-unified.json index d38dd4e6e0..bffa344441 100644 --- a/testproject/Packages/manifest-unified.json +++ b/testproject/Packages/manifest-unified.json @@ -8,11 +8,10 @@ "com.unity.ide.visualstudio": "2.0.26", "com.unity.mathematics": "1.4.0", "com.unity.multiplayer.tools": "2.2.11", - "com.unity.netcode": "6.7.0", + "com.unity.netcode": "7.0.0", "com.unity.netcode.gameobjects": "file:../../com.unity.netcode.gameobjects", "com.unity.package-validation-suite": "0.49.0-preview", "com.unity.services.authentication": "3.7.4", - "com.unity.services.multiplayer": "2.3.1", "com.unity.test-framework": "1.9.0", "com.unity.test-framework.performance": "6.7.0", "com.unity.timeline": "6.7.0", diff --git a/testproject/Packages/manifest.json b/testproject/Packages/manifest.json index eb043b44fc..667015e6db 100644 --- a/testproject/Packages/manifest.json +++ b/testproject/Packages/manifest.json @@ -11,7 +11,6 @@ "com.unity.netcode.gameobjects": "file:../../com.unity.netcode.gameobjects", "com.unity.package-validation-suite": "0.49.0-preview", "com.unity.services.authentication": "3.7.4", - "com.unity.services.multiplayer": "2.3.1", "com.unity.test-framework": "1.9.0", "com.unity.test-framework.performance": "6.7.0", "com.unity.timeline": "6.7.0",