diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md
index d253135563..423096ac35 100644
--- a/com.unity.netcode.gameobjects/CHANGELOG.md
+++ b/com.unity.netcode.gameobjects/CHANGELOG.md
@@ -6,7 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com).
-[Unreleased]
+## [Unreleased]
+
+### Added
+
+### Fixed
+
+### Changed
+
+
+## [2.2.0] - 2024-12-12
### Added
@@ -16,6 +25,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
### Fixed
+- Fixed issue where the server, host, or session owner would not populate the in-scene place `NetworkObject` table if the scene was loaded prior to starting the `NetworkManager`. (#3177)
- Fixed issue where the `NetworkObjectIdHash` value could be incorrect when entering play mode while still in prefab edit mode with pending changes and using MPPM. (#3162)
- Fixed issue where a sever only `NetworkManager` instance would spawn the actual `NetworkPrefab`'s `GameObject` as opposed to creating an instance of it. (#3160)
- Fixed issue where only the session owner (as opposed to all clients) would handle spawning prefab overrides properly when using a distributed authority network topology. (#3160)
@@ -216,8 +226,8 @@ Additional documentation and release notes are available at [Multiplayer Documen
## [2.0.0-exp.2] - 2024-04-02
### Added
-- Added updates to all internal messages to account for a distributed authority network session connection. (#2863)
-- Added `NetworkRigidbodyBase` that provides users with a more customizable network rigidbody, handles both `Rigidbody` and `Rigidbody2D`, and provides an option to make `NetworkTransform` use the rigid body for motion. (#2863)
+- Added updates to all internal messages to account for a distributed authority network session connection. (#2863)
+- Added `NetworkRigidbodyBase` that provides users with a more customizable network rigidbody, handles both `Rigidbody` and `Rigidbody2D`, and provides an option to make `NetworkTransform` use the rigid body for motion. (#2863)
- For a customized `NetworkRigidbodyBase` class:
- `NetworkRigidbodyBase.AutoUpdateKinematicState` provides control on whether the kinematic setting will be automatically set or not when ownership changes.
- `NetworkRigidbodyBase.AutoSetKinematicOnDespawn` provides control on whether isKinematic will automatically be set to true when the associated `NetworkObject` is despawned.
@@ -353,6 +363,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
- Fixed issue where you could not have multiple source network prefab overrides targeting the same network prefab as their override. (#2710)
### Changed
+
- Changed the server or host shutdown so it will now perform a "soft shutdown" when `NetworkManager.Shutdown` is invoked. This will send a disconnect notification to all connected clients and the server-host will wait for all connected clients to disconnect or timeout after a 5 second period before completing the shutdown process. (#2789)
- Changed `OnClientDisconnectedCallback` will now return the assigned client identifier on the local client side if the client was approved and assigned one prior to being disconnected. (#2789)
- Changed `NetworkTransform.SetState` (and related methods) now are cumulative during a fractional tick period and sent on the next pending tick. (#2777)
@@ -365,6 +376,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
- Changed in-scene placed `NetworkObject`s now set their `IsSceneObject` value when generating their `GlobalObjectIdHash` value. (#2710)
- Changed the default `NetworkConfig.SpawnTimeout` value from 1.0s to 10.0s. (#2710)
+
## [1.7.1] - 2023-11-15
### Added
@@ -414,7 +426,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
### Added
- Added a protected virtual method `NetworkTransform.OnInitialize(ref NetworkTransformState replicatedState)` that just returns the replicated state reference.
-
+
### Fixed
- Fixed issue where invoking `NetworkManager.Shutdown` within `NetworkManager.OnClientStopped` or `NetworkManager.OnServerStopped` would force `NetworkManager.ShutdownInProgress` to remain true after completing the shutdown process. (#2661)
diff --git a/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs
index 0684d74849..8ba4128b07 100644
--- a/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs
+++ b/com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs
@@ -237,7 +237,7 @@ private void DisplayNetworkManagerProperties()
if (m_NetworkManager.NetworkConfig.NetworkTopology == NetworkTopologyTypes.DistributedAuthority)
{
EditorGUILayout.PropertyField(m_AutoSpawnPlayerPrefabClientSide, new GUIContent("Auto Spawn Player Prefab"));
- }
+ }
#endif
EditorGUILayout.PropertyField(m_PlayerPrefabProperty, new GUIContent("Default Player Prefab"));
diff --git a/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs
index 25dd8967f1..0860fd9c92 100644
--- a/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs
+++ b/com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs
@@ -198,8 +198,8 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
// The below can cause visual anomalies and/or throws an exception within the EditorGUI itself (index out of bounds of the array). and has
// The visual anomaly is when you select one field it is set in the drop down but then the flags selection in the popup menu selects more items
// even though if you exit the popup menu the flag setting is correct.
- //var ownership = (NetworkObject.OwnershipStatus)EditorGUI.EnumFlagsField(position, label, (NetworkObject.OwnershipStatus)property.enumValueFlag);
- //property.enumValueFlag = (int)ownership;
+ // var ownership = (NetworkObject.OwnershipStatus)EditorGUI.EnumFlagsField(position, label, (NetworkObject.OwnershipStatus)property.enumValueFlag);
+ // property.enumValueFlag = (int)ownership;
EditorGUI.EndDisabledGroup();
EditorGUI.EndProperty();
}
diff --git a/com.unity.netcode.gameobjects/LICENSE.md b/com.unity.netcode.gameobjects/LICENSE.md
index 031978c204..ee8cecf4bf 100644
--- a/com.unity.netcode.gameobjects/LICENSE.md
+++ b/com.unity.netcode.gameobjects/LICENSE.md
@@ -1,7 +1,5 @@
Unity Companion License (UCL License)
-com.unity.netcode.gameobjects copyright © 2021-2024 Unity Technologies
+com.unity.netcode.gameobjects copyright © 2024 Unity Technologies
Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license).
Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.
-
-
diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs
index 7f2c4ae23a..583e7bda4a 100644
--- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs
@@ -298,14 +298,11 @@ private void ParseStateMachineStates(int layerIndex, ref AnimatorController anim
}
}
-#endif
-
///
/// Creates the TransitionStateInfoList table
///
private void BuildTransitionStateInfoList()
{
-#if UNITY_EDITOR
if (m_Animator == null)
{
return;
@@ -323,9 +320,18 @@ private void BuildTransitionStateInfoList()
var stateMachine = animatorController.layers[x].stateMachine;
ParseStateMachineStates(x, ref animatorController, ref stateMachine);
}
-#endif
}
+ ///
+ /// In-Editor Only
+ /// Virtual OnValidate method for custom derived NetworkAnimator classes.
+ ///
+ protected virtual void OnValidate()
+ {
+ BuildTransitionStateInfoList();
+ }
+#endif
+
public void OnAfterDeserialize()
{
BuildDestinationToTransitionInfoTable();
@@ -333,7 +339,7 @@ public void OnAfterDeserialize()
public void OnBeforeSerialize()
{
- BuildTransitionStateInfoList();
+ // Do nothing when serializing (handled during OnValidate)
}
internal struct AnimationState : INetworkSerializable
@@ -416,8 +422,8 @@ internal struct AnimationMessage : INetworkSerializable
internal bool HasBeenProcessed;
// This is preallocated/populated in OnNetworkSpawn for all instances in the event ownership or
- // authority changes. When serializing, IsDirtyCount determines how many AnimationState entries
- // should be serialized from the list. When deserializing the list is created and populated with
+ // authority changes. When serializing, IsDirtyCount determines how many AnimationState entries
+ // should be serialized from the list. When deserializing the list is created and populated with
// only the number of AnimationStates received which is dictated by the deserialized IsDirtyCount.
internal List AnimationStates;
@@ -493,7 +499,7 @@ internal bool IsServerAuthoritative()
}
///
- /// Override this method and return false to switch to owner authoritative mode
+ /// Override this method and return false to switch to owner authoritative mode.
///
///
/// When using a distributed authority network topology, this will default to
@@ -731,7 +737,7 @@ public override void OnNetworkDespawn()
}
///
- /// Wries all parameter and state information needed to initially synchronize a client
+ /// Writes all parameter and state information needed to initially synchronize a client
///
private void WriteSynchronizationData(ref BufferSerializer serializer) where T : IReaderWriter
{
@@ -806,8 +812,10 @@ private void WriteSynchronizationData(ref BufferSerializer serializer) whe
}
}
- animationState.Transition = isInTransition; // The only time this could be set to true
- animationState.StateHash = stateHash; // When a transition, this is the originating/starting state
+ // The only time this could be set to true
+ animationState.Transition = isInTransition;
+ // When a transition, this is the originating/starting state
+ animationState.StateHash = stateHash;
animationState.NormalizedTime = normalizedTime;
animationState.Layer = layer;
animationState.Weight = m_LayerWeights[layer];
@@ -881,7 +889,8 @@ private void CheckForStateChange(int layer)
{
m_TransitionHash[layer] = nt.fullPathHash;
m_AnimationHash[layer] = 0;
- animState.DestinationStateHash = nt.fullPathHash; // Next state is the destination state for cross fade
+ // Next state is the destination state for cross fade
+ animState.DestinationStateHash = nt.fullPathHash;
animState.CrossFade = true;
animState.Transition = true;
animState.Duration = tt.duration;
@@ -899,7 +908,8 @@ private void CheckForStateChange(int layer)
// first time in this transition for this layer
m_TransitionHash[layer] = tt.fullPathHash;
m_AnimationHash[layer] = 0;
- animState.StateHash = tt.fullPathHash; // Transitioning from state
+ // Transitioning from state
+ animState.StateHash = tt.fullPathHash;
animState.CrossFade = false;
animState.Transition = true;
animState.NormalizedTime = tt.normalizedTime;
@@ -1115,7 +1125,7 @@ private unsafe void WriteParameters(ref FastBufferWriter writer)
{
writer.Seek(0);
writer.Truncate();
- // Write how many parameter entries we are going to write
+ // Write out how many parameter entries to read
BytePacker.WriteValuePacked(writer, (uint)m_ParametersToUpdate.Count);
foreach (var parameterIndex in m_ParametersToUpdate)
{
@@ -1264,7 +1274,7 @@ internal void UpdateAnimationState(AnimationState animationState)
NetworkLog.LogError($"[DestinationState To Transition Info] Layer ({animationState.Layer}) sub-table does not contain destination state ({animationState.DestinationStateHash})!");
}
}
- // For reference, it is valid to have no transition information
+ // For reference, it is valid to have no transition information
//else if (NetworkManager.LogLevel == LogLevel.Developer)
//{
// NetworkLog.LogError($"[DestinationState To Transition Info] Layer ({animationState.Layer}) does not exist!");
@@ -1471,7 +1481,7 @@ private void InternalSetTrigger(int hash, bool isSet = true)
///
/// Distributed Authority: Internally-called RPC client receiving function to update a trigger when the server wants to forward
- /// a trigger for a client to play / reset
+ /// a trigger to a client
///
/// the payload containing the trigger data to apply
[Rpc(SendTo.NotAuthority)]
@@ -1482,7 +1492,7 @@ internal void SendAnimTriggerRpc(AnimationTriggerMessage animationTriggerMessage
///
/// Client Server: Internally-called RPC client receiving function to update a trigger when the server wants to forward
- /// a trigger for a client to play / reset
+ /// a trigger to a client
///
/// the payload containing the trigger data to apply
/// unused
@@ -1548,7 +1558,7 @@ public void SetTrigger(int hash, bool setTrigger = true)
}
///
- /// Resets the trigger for the associated animation. See SetTrigger for more on how triggers are special
+ /// Resets the trigger for the associated animation. See SetTrigger for more on how triggers are special
///
/// The string name of the trigger to reset
public void ResetTrigger(string triggerName)
@@ -1564,4 +1574,5 @@ public void ResetTrigger(int hash)
}
}
}
-#endif // COM_UNITY_MODULES_ANIMATION
+// COM_UNITY_MODULES_ANIMATION
+#endif
diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkRigidBodyBase.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkRigidBodyBase.cs
index 7e8808171a..18b393bec0 100644
--- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkRigidBodyBase.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkRigidBodyBase.cs
@@ -180,7 +180,7 @@ internal Vector3 GetAdjustedRotationThreshold()
///
///
/// For , only the x and y components of the are applied.
- ///
+ ///
public void SetLinearVelocity(Vector3 linearVelocity)
{
if (m_IsRigidbody2D)
@@ -546,7 +546,7 @@ public void SetIsKinematic(bool isKinematic)
{
if (IsKinematic())
{
- // If not already set to interpolate then set the Rigidbody to interpolate
+ // If not already set to interpolate then set the Rigidbody to interpolate
if (m_InternalRigidbody.interpolation == RigidbodyInterpolation.Extrapolate)
{
// Sleep until the next fixed update when switching from extrapolation to interpolation
@@ -849,36 +849,30 @@ public void DetachFromFixedJoint()
}
if (UseRigidBodyForMotion)
{
- if (m_IsRigidbody2D)
+ if (m_IsRigidbody2D && FixedJoint2D != null)
{
- if (FixedJoint2D != null)
+ if (!m_FixedJoint2DUsingGravity)
{
- if (!m_FixedJoint2DUsingGravity)
- {
- FixedJoint2D.connectedBody.gravityScale = m_OriginalGravityScale;
- }
- FixedJoint2D.connectedBody = null;
- Destroy(FixedJoint2D);
- FixedJoint2D = null;
- ResetInterpolation();
- RemoveFromParentBody();
+ FixedJoint2D.connectedBody.gravityScale = m_OriginalGravityScale;
}
+ FixedJoint2D.connectedBody = null;
+ Destroy(FixedJoint2D);
+ FixedJoint2D = null;
+ ResetInterpolation();
+ RemoveFromParentBody();
}
- else
+ else if (FixedJoint != null)
{
- if (FixedJoint != null)
- {
- FixedJoint.connectedBody = null;
- m_InternalRigidbody.useGravity = m_OriginalGravitySetting;
- Destroy(FixedJoint);
- FixedJoint = null;
- ResetInterpolation();
- RemoveFromParentBody();
- }
+ FixedJoint.connectedBody = null;
+ m_InternalRigidbody.useGravity = m_OriginalGravitySetting;
+ Destroy(FixedJoint);
+ FixedJoint = null;
+ ResetInterpolation();
+ RemoveFromParentBody();
}
}
}
}
}
-#endif // COM_UNITY_MODULES_PHYSICS
-
+// COM_UNITY_MODULES_PHYSICS
+#endif
diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
index a103b0fc4b..3d2be47c63 100644
--- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
@@ -32,7 +32,8 @@ public class NetworkTransform : NetworkBehaviour
///
public struct NetworkTransformState : INetworkSerializable
{
- private const int k_InLocalSpaceBit = 0x00000001; // Persists between state updates (authority dictates if this is set)
+ // Persists between state updates (authority dictates if this is set)
+ private const int k_InLocalSpaceBit = 0x00000001;
private const int k_PositionXBit = 0x00000002;
private const int k_PositionYBit = 0x00000004;
private const int k_PositionZBit = 0x00000008;
@@ -43,18 +44,25 @@ public struct NetworkTransformState : INetworkSerializable
private const int k_ScaleYBit = 0x00000100;
private const int k_ScaleZBit = 0x00000200;
private const int k_TeleportingBit = 0x00000400;
- private const int k_Interpolate = 0x00000800; // Persists between state updates (authority dictates if this is set)
- private const int k_QuaternionSync = 0x00001000; // Persists between state updates (authority dictates if this is set)
- private const int k_QuaternionCompress = 0x00002000; // Persists between state updates (authority dictates if this is set)
- private const int k_UseHalfFloats = 0x00004000; // Persists between state updates (authority dictates if this is set)
+ // Persists between state updates (authority dictates if this is set)
+ private const int k_Interpolate = 0x00000800;
+ // Persists between state updates (authority dictates if this is set)
+ private const int k_QuaternionSync = 0x00001000;
+ // Persists between state updates (authority dictates if this is set)
+ private const int k_QuaternionCompress = 0x00002000;
+ // Persists between state updates (authority dictates if this is set)
+ private const int k_UseHalfFloats = 0x00004000;
private const int k_Synchronization = 0x00008000;
- private const int k_PositionSlerp = 0x00010000; // Persists between state updates (authority dictates if this is set)
- private const int k_IsParented = 0x00020000; // When parented and synchronizing, we need to have both lossy and local scale due to varying spawn order
+ // Persists between state updates (authority dictates if this is set)
+ private const int k_PositionSlerp = 0x00010000;
+ // When parented and synchronizing, we need to have both lossy and local scale due to varying spawn order
+ private const int k_IsParented = 0x00020000;
private const int k_SynchBaseHalfFloat = 0x00040000;
private const int k_ReliableSequenced = 0x00080000;
private const int k_UseUnreliableDeltas = 0x00100000;
private const int k_UnreliableFrameSync = 0x00200000;
- private const int k_TrackStateId = 0x10000000; // (Internal Debugging) When set each state update will contain a state identifier
+ // (Internal Debugging) When set each state update will contain a state identifier
+ private const int k_TrackStateId = 0x10000000;
// Stores persistent and state relative flags
private uint m_Bitset;
@@ -409,8 +417,8 @@ internal set
}
///
- /// Returns whether this state update was a frame synchronization when
- /// UseUnreliableDeltas is enabled. When set, the entire transform will
+ /// Returns whether this state update was a frame synchronization when
+ /// UseUnreliableDeltas is enabled. When set, the entire transform will
/// be or has been synchronized.
///
public bool IsUnreliableFrameSync()
@@ -929,8 +937,6 @@ public void NetworkSerialize(BufferSerializer serializer) where T : IReade
#endregion
#region PROPERTIES AND GENERAL METHODS
-
-
public enum AuthorityModes
{
Server,
@@ -1370,7 +1376,8 @@ internal NetworkTransformState LocalAuthoritativeNetworkState
private BufferedLinearInterpolatorVector3 m_PositionInterpolator;
private BufferedLinearInterpolatorVector3 m_ScaleInterpolator;
- private BufferedLinearInterpolatorQuaternion m_RotationInterpolator; // rotation is a single Quaternion since each Euler axis will affect the quaternion's final value
+ // rotation is a single Quaternion since each Euler axis will affect the quaternion's final value
+ private BufferedLinearInterpolatorQuaternion m_RotationInterpolator;
// The previous network state
private NetworkTransformState m_OldState = new NetworkTransformState();
@@ -1643,11 +1650,11 @@ private void TryCommitTransform(ref Transform transformToCommit, bool synchroniz
Debug.LogException(ex);
}
- // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if
+ // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if
// we have already sent at least one unreliable delta state update. At this point in the callstack,
// a delta state update has just been sent in the above UpdateTransformState() call and as long as
// we didn't send a frame synch and we are not synchronizing then we know at least one unreliable
- // delta has been sent. Under this scenario, we should start checking for this instance's alloted
+ // delta has been sent. Under this scenario, we should start checking for this instance's alloted
// frame synch "tick slot". Once we send a frame synch, if no other deltas occur after that
// (i.e. the object is at rest) then we will stop sending frame synch's until the object begins
// moving, rotating, or scaling again.
@@ -1964,7 +1971,7 @@ private bool CheckForStateChange(ref NetworkTransformState networkState, ref Tra
networkState.NetworkDeltaPosition = m_HalfPositionState;
- // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position
+ // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position
if ((m_HalfFloatTargetTickOwnership > m_CachedNetworkManager.ServerTime.Tick || isAxisSync) && !networkState.IsTeleportingNextFrame)
{
networkState.SynchronizeBaseHalfFloat = true;
@@ -3403,7 +3410,7 @@ internal void ChildRegistration(NetworkObject child, bool isAdding)
/// - Local space to local space ( parent to parent)
/// Will all smoothly transition while interpolation is enabled.
/// (Does not work if using a or for motion)
- ///
+ ///
/// When a parent changes, non-authoritative instances should:
/// - Apply the resultant position, rotation, and scale from the parenting action.
/// - Clear interpolators (even if not enabled on this frame)
@@ -3575,7 +3582,7 @@ private void SetStateInternal(Vector3 pos, Quaternion rot, Vector3 scale, bool s
var transformToCommit = transform;
- // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will
+ // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will
// update the axial deltas to whatever changes are applied). As such, we need to preserve the dirty and explicit
// state flags.
var stateWasDirty = m_LocalAuthoritativeNetworkState.IsDirty;
@@ -3658,7 +3665,7 @@ private void UpdateInterpolation()
var serverTime = m_CachedNetworkManager.ServerTime;
var cachedServerTime = serverTime.Time;
- //var offset = (float)serverTime.TickOffset;
+ // var offset = (float)serverTime.TickOffset;
#if COM_UNITY_MODULES_PHYSICS || COM_UNITY_MODULES_PHYSICS2D
var cachedDeltaTime = m_UseRigidbodyForMotion ? m_CachedNetworkManager.RealTimeProvider.FixedDeltaTime : m_CachedNetworkManager.RealTimeProvider.DeltaTime;
#else
@@ -3669,7 +3676,7 @@ private void UpdateInterpolation()
// is to make their cachedRenderTime run 2 ticks behind.
// TODO: This could most likely just always be 2
- //var ticksAgo = ((!IsServerAuthoritative() && !IsServer) || m_CachedNetworkManager.DistributedAuthorityMode) && !m_CachedNetworkManager.DAHost ? 2 : 1;
+ // var ticksAgo = ((!IsServerAuthoritative() && !IsServer) || m_CachedNetworkManager.DistributedAuthorityMode) && !m_CachedNetworkManager.DAHost ? 2 : 1;
var ticksAgo = 2;
var cachedRenderTime = serverTime.TimeTicksAgo(ticksAgo).Time;
@@ -3746,7 +3753,7 @@ public virtual void OnFixedUpdate()
///
/// Determines whether the is or based on the property.
- /// You can override this method to control this logic.
+ /// You can override this method to control this logic.
///
/// or
protected virtual bool OnIsServerAuthoritative()
@@ -3772,7 +3779,6 @@ public bool IsServerAuthoritative()
return OnIsServerAuthoritative();
}
}
-
#endregion
#region MESSAGE HANDLING
@@ -3964,7 +3970,7 @@ internal float TicksAgoInSeconds()
{
return 2 * m_TickFrequency;
// TODO: We need an RTT that updates regularly and not just when the client sends packets
- //return Mathf.Max(1.0f, TicksAgo) * m_TickFrequency;
+ // return Mathf.Max(1.0f, TicksAgo) * m_TickFrequency;
}
///
@@ -3974,25 +3980,25 @@ internal float TicksAgoInSeconds()
private void TickUpdate()
{
// TODO: We need an RTT that updates regularly and not just when the client sends packets
- //if (m_UnityTransport != null)
- //{
- // // Determine the desired ticks ago by the RTT (this really should be the combination of the
- // // authority and non-authority 1/2 RTT but in the end anything beyond 300ms is considered very poor
- // // network quality so latent interpolation is going to be expected).
- // var rtt = Mathf.Max(m_TickInMS, m_UnityTransport.GetCurrentRtt(NetworkManager.ServerClientId));
- // m_TicksAgoSamples[m_TickSampleIndex] = Mathf.Max(1, (int)(rtt * m_TickFrequency));
- // var tickAgoSum = 0.0f;
- // foreach (var tickAgo in m_TicksAgoSamples)
- // {
- // tickAgoSum += tickAgo;
- // }
- // m_PreviousTicksAgo = TicksAgo;
- // TicksAgo = Mathf.Lerp(m_PreviousTicksAgo, tickAgoSum / m_TickRate, m_TickFrequency);
- // m_TickSampleIndex = (m_TickSampleIndex + 1) % m_TickRate;
- // // Get the partial tick value for when this is all calculated to provide an offset for determining
- // // the relative starting interpolation point for the next update
- // Offset = m_OffsetTickFrequency * (Mathf.Max(2, TicksAgo) - (int)TicksAgo);
- //}
+ // if (m_UnityTransport != null)
+ // {
+ // // Determine the desired ticks ago by the RTT (this really should be the combination of the
+ // // authority and non-authority 1/2 RTT but in the end anything beyond 300ms is considered very poor
+ // // network quality so latent interpolation is going to be expected).
+ // var rtt = Mathf.Max(m_TickInMS, m_UnityTransport.GetCurrentRtt(NetworkManager.ServerClientId));
+ // m_TicksAgoSamples[m_TickSampleIndex] = Mathf.Max(1, (int)(rtt * m_TickFrequency));
+ // var tickAgoSum = 0.0f;
+ // foreach (var tickAgo in m_TicksAgoSamples)
+ // {
+ // tickAgoSum += tickAgo;
+ // }
+ // m_PreviousTicksAgo = TicksAgo;
+ // TicksAgo = Mathf.Lerp(m_PreviousTicksAgo, tickAgoSum / m_TickRate, m_TickFrequency);
+ // m_TickSampleIndex = (m_TickSampleIndex + 1) % m_TickRate;
+ // // Get the partial tick value for when this is all calculated to provide an offset for determining
+ // // the relative starting interpolation point for the next update
+ // Offset = m_OffsetTickFrequency * (Mathf.Max(2, TicksAgo) - (int)TicksAgo);
+ // }
// TODO FIX: The local NetworkTickSystem can invoke with the same network tick as before
if (m_NetworkManager.ServerTime.Tick <= m_LastTick)
@@ -4012,13 +4018,13 @@ private void TickUpdate()
private UnityTransport m_UnityTransport;
private float m_TickFrequency;
- //private float m_OffsetTickFrequency;
- //private ulong m_TickInMS;
- //private int m_TickSampleIndex;
+ // private float m_OffsetTickFrequency;
+ // private ulong m_TickInMS;
+ // private int m_TickSampleIndex;
private int m_TickRate;
public float TicksAgo { get; private set; }
- //public float Offset { get; private set; }
- //private float m_PreviousTicksAgo;
+ // public float Offset { get; private set; }
+ // private float m_PreviousTicksAgo;
private List m_TicksAgoSamples = new List();
@@ -4032,16 +4038,16 @@ public NetworkTransformTickRegistration(NetworkManager networkManager)
//// For the offset, it uses the fractional remainder of the tick to determine the offset.
//// In order to keep within tick boundaries, we increment the tick rate by 1 to assure it
//// will always be < the tick frequency.
- //m_OffsetTickFrequency = 1.0f / (m_TickRate + 1);
- //m_TickInMS = (ulong)(1000 * m_TickFrequency);
- //m_UnityTransport = m_NetworkManager.NetworkConfig.NetworkTransport as UnityTransport;
+ // m_OffsetTickFrequency = 1.0f / (m_TickRate + 1);
+ // m_TickInMS = (ulong)(1000 * m_TickFrequency);
+ // m_UnityTransport = m_NetworkManager.NetworkConfig.NetworkTransport as UnityTransport;
//// Fill the sample with a starting value of 1
- //for (int i = 0; i < m_TickRate; i++)
- //{
- // m_TicksAgoSamples.Add(1f);
- //}
+ // for (int i = 0; i < m_TickRate; i++)
+ // {
+ // m_TicksAgoSamples.Add(1f);
+ // }
TicksAgo = 2f;
- //m_PreviousTicksAgo = 1f;
+ // m_PreviousTicksAgo = 1f;
if (networkManager.IsServer)
{
networkManager.OnServerStopped += OnNetworkManagerStopped;
diff --git a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs
index d0808d2886..02f9c98e7e 100644
--- a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs
@@ -27,7 +27,7 @@ public struct ContactEventHandlerInfo
}
///
- /// Default implementation required to register a with a instance.
+ /// Default implementation required to register a with a instance.
///
///
/// Recommended to implement this method on a component
@@ -52,7 +52,7 @@ public interface IContactEventHandler
}
///
- /// This is an extended version of and can be used to register a with a instance.
+ /// This is an extended version of and can be used to register a with a instance.
/// This provides additional information to the for each set of contact events it is processing.
///
public interface IContactEventHandlerWithInfo : IContactEventHandler
@@ -66,9 +66,9 @@ public interface IContactEventHandlerWithInfo : IContactEventHandler
///
/// Add this component to an in-scene placed GameObject to provide faster collision event processing between instances and optionally static colliders.
- ///
- ///
- ///
+ ///
+ ///
+ ///
///
[AddComponentMenu("Netcode/Rigidbody Contact Event Manager")]
public class RigidbodyContactEventManager : MonoBehaviour
diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObjectRefreshTool.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObjectRefreshTool.cs
index 63d48e914d..5309377475 100644
--- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObjectRefreshTool.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObjectRefreshTool.cs
@@ -11,7 +11,7 @@
namespace Unity.Netcode
{
///
- /// This is a helper tool to update all in-scene placed instances of a prefab that
+ /// This is a helper tool to update all in-scene placed instances of a prefab that
/// originally did not have a NetworkObject component but one was added to the prefab
/// later.
///
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/ILPPMessageProvider.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/ILPPMessageProvider.cs
index b7f90f658f..4e697acc0d 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/ILPPMessageProvider.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/ILPPMessageProvider.cs
@@ -16,7 +16,7 @@ internal struct ILPPMessageProvider : INetworkMessageProvider
///
/// Enum representing the different types of messages that can be sent over the network.
/// The values cannot be changed, as they are used to serialize and deserialize messages.
- /// Adding new messages should be done by adding new values to the end of the enum
+ /// Adding new messages should be done by adding new values to the end of the enum
/// using the next free value.
///
/// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/ChangeOwnershipMessage.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/ChangeOwnershipMessage.cs
index cb4f114b91..998e84d640 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/ChangeOwnershipMessage.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/ChangeOwnershipMessage.cs
@@ -17,7 +17,7 @@ internal struct ChangeOwnershipMessage : INetworkMessage, INetworkSerializeByMem
///
/// When requesting, RequestClientId is the requestor.
/// When approving, RequestClientId is the owner that approved.
- /// When responding (only for denied), RequestClientId is the requestor
+ /// When responding (only for denied), RequestClientId is the requestor
///
internal ulong RequestClientId;
internal int ClientIdCount;
@@ -272,7 +272,7 @@ public void Handle(ref NetworkContext context)
networkManager.ConnectionManager.SendMessage(ref message, NetworkDelivery.Reliable, clientId);
}
}
- // If the NetworkObject is not visible to the DAHost client, then exit early
+ // If the NetworkObject is not visible to the DAHost client, then exit early
if (!networkManager.SpawnManager.SpawnedObjects.ContainsKey(NetworkObjectId))
{
return;
@@ -294,7 +294,7 @@ public void Handle(ref NetworkContext context)
}
///
- /// Handle the
+ /// Handle the extended distributed authority ownership updates
///
///
private void HandleExtendedOwnershipUpdate(ref NetworkContext context)
@@ -351,10 +351,10 @@ private void HandleOwnershipChange(ref NetworkContext context)
networkObject.InvokeBehaviourOnLostOwnership();
}
- // If in distributed authority mode
+ // If in distributed authority mode
if (networkManager.DistributedAuthorityMode)
{
- // Always update the network properties in distributed authority mode
+ // Always update the network properties in distributed authority mode
for (int i = 0; i < networkObject.ChildNetworkBehaviours.Count; i++)
{
networkObject.ChildNetworkBehaviours[i].UpdateNetworkProperties();
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/CreateObjectMessage.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/CreateObjectMessage.cs
index 6c0656b90a..02f4263e9d 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/CreateObjectMessage.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/CreateObjectMessage.cs
@@ -257,7 +257,7 @@ internal static void CreateObject(ref NetworkManager networkManager, ulong sende
{
// DA - NGO CMB SERVICE NOTES:
// (*** See above notes fist ***)
- // If it is a player object freshly spawning and one or more clients all connect at the exact same time (i.e. received on effectively
+ // If it is a player object freshly spawning and one or more clients all connect at the exact same time (i.e. received on effectively
// the same frame), then we need to check the observers list to make sure all players are visible upon first spawning. At a later date,
// for area of interest we will need to have some form of follow up "observer update" message to cull out players not within each
// player's AOI.
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/NetworkTransformMessage.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/NetworkTransformMessage.cs
index 56f25f22c2..cf4013f469 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/NetworkTransformMessage.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/Messages/NetworkTransformMessage.cs
@@ -128,7 +128,7 @@ public bool Deserialize(FastBufferReader reader, ref NetworkContext context, int
}
else if (networkManager.DAHost)
{
- // Specific to distributed authority mode, the only sender of state updates will be the owner
+ // Specific to distributed authority mode, the only sender of state updates will be the owner
ownerClientId = context.SenderId;
}
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs
index 0db593f23b..87bfbfb1c4 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs
@@ -43,7 +43,7 @@ internal override void Send(NetworkBehaviour behaviour, ref RpcMessage message,
using var tempBuffer = new FastBufferReader(message.WriteBuffer, Allocator.None);
message.ReadBuffer = tempBuffer;
message.Handle(ref context);
- // If enabled, then add the RPC metrics for this
+ // If enabled, then add the RPC metrics for this
#if DEVELOPMENT_BUILD || UNITY_EDITOR || UNITY_MP_TOOLS_NET_STATS_MONITOR_ENABLED_IN_RELEASE
int length = tempBuffer.Length;
if (NetworkBehaviour.__rpc_name_table[behaviour.GetType()].TryGetValue(message.Metadata.NetworkRpcMethodId, out var rpcMethodName))
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/BitWriter.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/BitWriter.cs
index 9eacd5601f..0e3ccfb7e3 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/BitWriter.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/BitWriter.cs
@@ -62,7 +62,7 @@ public void Dispose()
/// When you know you will be writing multiple fields back-to-back and you know the total size,
/// you can call TryBeginWriteBits() once on the total size, and then follow it with calls to
/// WriteBit() or WriteBits().
- ///
+ ///
/// Bitwise write operations will throw OverflowException in editor and development builds if you
/// go past the point you've marked using TryBeginWriteBits(). In release builds, OverflowException will not be thrown
/// for performance reasons, since the point of using TryBeginWrite is to avoid bounds checking in the following
diff --git a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs
index ed0b0348b7..854bc8fba2 100644
--- a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs
@@ -1449,6 +1449,15 @@ internal void ServerSpawnSceneObjectsOnStartSweep()
}
}
+ // Since we are spawing in-scene placed NetworkObjects for already loaded scenes,
+ // we need to add any in-scene placed NetworkObject to our tracking table
+ var clearFirst = true;
+ foreach (var sceneLoaded in NetworkManager.SceneManager.ScenesLoaded)
+ {
+ NetworkManager.SceneManager.PopulateScenePlacedObjects(sceneLoaded.Value, clearFirst);
+ clearFirst = false;
+ }
+
// Notify all in-scene placed NetworkObjects have been spawned
foreach (var networkObject in networkObjectsToSpawn)
{
diff --git a/com.unity.netcode.gameobjects/Samples~/Bootstrap/Scripts/Bootstrap.asmdef b/com.unity.netcode.gameobjects/Samples~/Bootstrap/Scripts/Bootstrap.asmdef
index 07a8ac0096..54cb675609 100644
--- a/com.unity.netcode.gameobjects/Samples~/Bootstrap/Scripts/Bootstrap.asmdef
+++ b/com.unity.netcode.gameobjects/Samples~/Bootstrap/Scripts/Bootstrap.asmdef
@@ -1,7 +1,7 @@
{
- "name": "Bootstrap",
+ "name": "Bootstrap",
"rootNamespace": "Unity.Netcode.Samples",
"references": [
"Unity.Netcode.Runtime"
]
-}
+}
\ No newline at end of file
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs
index ca402c6095..229a067758 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformOwnershipTests.cs
@@ -869,7 +869,7 @@ public IEnumerator NestedNetworkTransformSpawnPositionTest()
foreach (var networkManager in m_NetworkManagers)
{
- // Randomize the position
+ // Randomize the position
RandomizeObjectTransformPositions(m_SpawnObject);
// Create an instance owned by the specified networkmanager
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs
index 95ca7e0f20..7e12934a67 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs
@@ -123,7 +123,7 @@ private void UpdateTransformWorld(Components.NetworkTransform networkTransformTe
}
///
- /// This test validates the SwitchTransformSpaceWhenParented setting under all network topologies
+ /// This test validates the SwitchTransformSpaceWhenParented setting under all network topologies
///
[Test]
public void SwitchTransformSpaceWhenParentedTest([Values(0.5f, 1.0f, 5.0f)] float scale)
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableCollectionsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableCollectionsTests.cs
index 0c8a2ffdf9..3276b3d3df 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableCollectionsTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableCollectionsTests.cs
@@ -20,7 +20,7 @@ namespace Unity.Netcode.RuntimeTests
/// - HashSet
/// This also does some testing on nested collections, but does
/// not test every possible combination.
- ///
+ ///
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.Server)]
public class NetworkVariableCollectionsTests : NetcodeIntegrationTest
@@ -218,7 +218,7 @@ public IEnumerator TestListBuiltInTypeCollections()
yield return WaitForConditionOrTimeOut(() => compInt.CompareTrackedChanges(ListTestHelperBase.Targets.Owner));
AssertOnTimeout($"Client-{client.LocalClientId} full set failed to synchronize on {nameof(ListTestHelperInt)} {compInt.name}!");
//////////////////////////////////
- // Server Full Set
+ // Server Full Set
compIntServer.FullSet(GetRandomIntList(5), ListTestHelperBase.Targets.Server);
yield return WaitForConditionOrTimeOut(() => compIntServer.CompareTrackedChanges(ListTestHelperBase.Targets.Server));
AssertOnTimeout($"Server full set failed to synchronize on {nameof(ListTestHelperInt)} {compIntServer.name}!");
@@ -285,7 +285,7 @@ public IEnumerator TestListBuiltInTypeCollections()
// Only test restore on non-host clients (otherwise a host is both server and client/owner)
if (!client.IsServer)
{
- // No Write Client Remove List item with CheckDirtyState restore
+ // No Write Client Remove List item with CheckDirtyState restore
compListInt.Remove(compListInt.ListCollectionServer.Value[index], ListTestHelperBase.Targets.Server);
yield return WaitForConditionOrTimeOut(() => compListInt.CompareTrackedChanges(ListTestHelperBase.Targets.Server));
AssertOnTimeout($"Client-{client.LocalClientId} remove failed to restore on {nameof(ListTestHelperListInt)} {compListIntServer.name}! {compListIntServer.GetLog()}");
@@ -474,7 +474,7 @@ public IEnumerator TestListSerializableObjectCollections()
yield return WaitForConditionOrTimeOut(() => compObjectServer.CompareTrackedChanges(ListTestHelperBase.Targets.Server));
AssertOnTimeout($"Client-{client.LocalClientId} change failed to restore on {nameof(ListTestHelperSerializableObject)} {compObjectServer.name}!");
- // No Write Client Remove Serializable item with owner state update restore
+ // No Write Client Remove Serializable item with owner state update restore
compObject.ListCollectionServer.Value[index] = SerializableObject.GetRandomObject();
}
compObjectServer.ListCollectionServer.Value[index] = SerializableObject.GetRandomObject();
@@ -838,7 +838,7 @@ public IEnumerator TestDictionaryCollections()
compDictionaryServer.ListCollectionOwner.IsDirty();
yield return WaitForConditionOrTimeOut(() => compDictionaryServer.CompareTrackedChanges(ListTestHelperBase.Targets.Owner));
AssertOnTimeout($"Server add to owner write collection property failed to restore on {className} {compDictionaryServer.name}! {compDictionaryServer.GetLog()}");
- // Server-side add the same key and SerializableObject to owner write permission (would throw key exists exception too if previous failed)
+ // Server-side add the same key and SerializableObject to owner write permission (would throw key exists exception too if previous failed)
compDictionaryServer.ListCollectionOwner.Value.Add(newEntry.Item1, newEntry.Item2);
// Server-side add a completely new key and SerializableObject to to owner write permission property
compDictionaryServer.ListCollectionOwner.Value.Add(GetNextKey(), SerializableObject.GetRandomObject());
@@ -864,7 +864,7 @@ public IEnumerator TestDictionaryCollections()
compDictionary.ListCollectionServer.IsDirty();
yield return WaitForConditionOrTimeOut(() => compDictionary.CompareTrackedChanges(ListTestHelperBase.Targets.Server));
AssertOnTimeout($"Client-{client.LocalClientId} add to server write collection property failed to restore on {className} {compDictionary.name}! {compDictionary.GetLog()}");
- // Client-side add the same key and SerializableObject to server write permission property (would throw key exists exception too if previous failed)
+ // Client-side add the same key and SerializableObject to server write permission property (would throw key exists exception too if previous failed)
compDictionary.ListCollectionServer.Value.Add(newEntry.Item1, newEntry.Item2);
// Client-side add a completely new key and SerializableObject to to server write permission property
compDictionary.ListCollectionServer.Value.Add(GetNextKey(), SerializableObject.GetRandomObject());
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Prefabs/NetworkPrefabOverrideTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Prefabs/NetworkPrefabOverrideTests.cs
index b7d86e3356..84d9c56fec 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/Prefabs/NetworkPrefabOverrideTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/Prefabs/NetworkPrefabOverrideTests.cs
@@ -109,7 +109,7 @@ protected override void OnServerAndClientsCreated()
playerPrefabOverrideHandler.ServerSideInstance = m_PlayerPrefab;
playerPrefabOverrideHandler.ClientSideInstance = m_ClientSidePlayerPrefab.Prefab;
- // Add the NetworkPrefab with override
+ // Add the NetworkPrefab with override
m_ServerNetworkManager.NetworkConfig.Prefabs.Add(m_PrefabOverride);
// Add the client player prefab that will be used on clients (and the host)
m_ServerNetworkManager.NetworkConfig.Prefabs.Add(m_ClientSidePlayerPrefab);
@@ -121,7 +121,7 @@ protected override void OnServerAndClientsCreated()
playerPrefabOverrideHandler.ServerSideInstance = m_PlayerPrefab;
playerPrefabOverrideHandler.ClientSideInstance = m_ClientSidePlayerPrefab.Prefab;
- // Add the NetworkPrefab with override
+ // Add the NetworkPrefab with override
networkManager.NetworkConfig.Prefabs.Add(m_PrefabOverride);
// Add the client player prefab that will be used on clients (and the host)
networkManager.NetworkConfig.Prefabs.Add(m_ClientSidePlayerPrefab);
diff --git a/com.unity.netcode.gameobjects/package.json b/com.unity.netcode.gameobjects/package.json
index edbce0938e..c20e366c3c 100644
--- a/com.unity.netcode.gameobjects/package.json
+++ b/com.unity.netcode.gameobjects/package.json
@@ -2,11 +2,11 @@
"name": "com.unity.netcode.gameobjects",
"displayName": "Netcode for GameObjects",
"description": "Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.",
- "version": "2.1.1",
+ "version": "2.2.0",
"unity": "6000.0",
"dependencies": {
"com.unity.nuget.mono-cecil": "1.11.4",
- "com.unity.transport": "2.3.0"
+ "com.unity.transport": "2.4.0"
},
"samples": [
{