com.unity.netcode.gameobjects@2.0.0-pre.4
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com). ## [2.0.0-pre.4] - 2024-08-21 ### Added - Added `NetworkVariable.CheckDirtyState` that is to be used in tandem with collections in order to detect whether the collection or an item within the collection has changed. (#3004) ### Fixed - Fixed issue where nested `NetworkTransform` components were not getting updated. (#3016) - Fixed issue by adding null checks in `NetworkVariableBase.CanClientRead` and `NetworkVariableBase.CanClientWrite` methods to ensure safe access to `NetworkBehaviour`. (#3012) - Fixed issue where `FixedStringSerializer<T>` was using `NetworkVariableSerialization<byte>.AreEqual` to determine if two bytes were equal causes an exception to be thrown due to no byte serializer having been defined. (#3009) - Fixed Issue where a state with dual triggers, inbound and outbound, could cause a false layer to layer state transition message to be sent to non-authority `NetworkAnimator` instances and cause a warning message to be logged. (#3008) - Fixed issue using collections within `NetworkVariable` where the collection would not detect changes to items or nested items. (#3004) - Fixed issue where `List`, `Dictionary`, and `HashSet` collections would not uniquely duplicate nested collections. (#3004) - Fixed issue where `NotAuthorityTarget` would include the service observer in the list of targets to send the RPC to as opposed to excluding the service observer as it should. (#3000) - Fixed issue where `ProxyRpcTargetGroup` could attempt to send a message if there were no targets to send to. (#3000) ### Changed - Changed `NetworkAnimator` to automatically switch to owner authoritative mode when using a distributed authority network topology. (#3021) - Changed permissions exception thrown in `NetworkList` to exiting early with a logged error that is now a unified permissions message within `NetworkVariableBase`. (#3004) - Changed permissions exception thrown in `NetworkVariable.Value` to exiting early with a logged error that is now a unified permissions message within `NetworkVariableBase`. (#3004)
This commit is contained in:
@@ -498,9 +498,13 @@ namespace Unity.Netcode.Components
|
||||
/// <summary>
|
||||
/// Override this method and return false to switch to owner authoritative mode
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When using a distributed authority network topology, this will default to
|
||||
/// owner authoritative.
|
||||
/// </remarks>
|
||||
protected virtual bool OnIsServerAuthoritative()
|
||||
{
|
||||
return true;
|
||||
return NetworkManager ? !NetworkManager.DistributedAuthorityMode : true;
|
||||
}
|
||||
|
||||
// Animators only support up to 32 parameters
|
||||
@@ -851,7 +855,12 @@ namespace Unity.Netcode.Components
|
||||
stateChangeDetected = true;
|
||||
//Debug.Log($"[Cross-Fade] To-Hash: {nt.fullPathHash} | TI-Duration: ({tt.duration}) | TI-Norm: ({tt.normalizedTime}) | From-Hash: ({m_AnimationHash[layer]}) | SI-FPHash: ({st.fullPathHash}) | SI-Norm: ({st.normalizedTime})");
|
||||
}
|
||||
else if (!tt.anyState && tt.fullPathHash != m_TransitionHash[layer])
|
||||
// If we are not transitioned into the "any state" and the animator transition isn't a full path hash (layer to layer) and our pre-built destination state to transition does not contain the
|
||||
// current layer (i.e. transitioning into a state from another layer) =or= we do contain the layer and the layer contains state to transition to is contained within our pre-built destination
|
||||
// state then we can handle this transition as a non-cross fade state transition between layers.
|
||||
// Otherwise, if we don't enter into this then this is a "trigger transition to some state that is now being transitioned back to the Idle state via trigger" or "Dual Triggers" IDLE<-->State.
|
||||
else if (!tt.anyState && tt.fullPathHash != m_TransitionHash[layer] && (!m_DestinationStateToTransitioninfo.ContainsKey(layer) ||
|
||||
(m_DestinationStateToTransitioninfo.ContainsKey(layer) && m_DestinationStateToTransitioninfo[layer].ContainsKey(nt.fullPathHash))))
|
||||
{
|
||||
// first time in this transition for this layer
|
||||
m_TransitionHash[layer] = tt.fullPathHash;
|
||||
@@ -860,6 +869,10 @@ namespace Unity.Netcode.Components
|
||||
animState.CrossFade = false;
|
||||
animState.Transition = true;
|
||||
animState.NormalizedTime = tt.normalizedTime;
|
||||
if (m_DestinationStateToTransitioninfo.ContainsKey(layer) && m_DestinationStateToTransitioninfo[layer].ContainsKey(nt.fullPathHash))
|
||||
{
|
||||
animState.DestinationStateHash = nt.fullPathHash;
|
||||
}
|
||||
stateChangeDetected = true;
|
||||
//Debug.Log($"[Transition] TI-Duration: ({tt.duration}) | TI-Norm: ({tt.normalizedTime}) | From-Hash: ({m_AnimationHash[layer]}) |SI-FPHash: ({st.fullPathHash}) | SI-Norm: ({st.normalizedTime})");
|
||||
}
|
||||
|
||||
@@ -2960,7 +2960,10 @@ namespace Unity.Netcode.Components
|
||||
#else
|
||||
var forUpdate = true;
|
||||
#endif
|
||||
NetworkManager?.NetworkTransformRegistration(this, forUpdate, false);
|
||||
if (m_CachedNetworkObject != null)
|
||||
{
|
||||
NetworkManager?.NetworkTransformRegistration(m_CachedNetworkObject, forUpdate, false);
|
||||
}
|
||||
DeregisterForTickUpdate(this);
|
||||
CanCommitToTransform = false;
|
||||
}
|
||||
@@ -3069,7 +3072,7 @@ namespace Unity.Netcode.Components
|
||||
if (CanCommitToTransform)
|
||||
{
|
||||
// Make sure authority doesn't get added to updates (no need to do this on the authority side)
|
||||
m_CachedNetworkManager.NetworkTransformRegistration(this, forUpdate, false);
|
||||
m_CachedNetworkManager.NetworkTransformRegistration(NetworkObject, forUpdate, false);
|
||||
if (UseHalfFloatPrecision)
|
||||
{
|
||||
m_HalfPositionState = new NetworkDeltaPosition(currentPosition, m_CachedNetworkManager.ServerTime.Tick, math.bool3(SyncPositionX, SyncPositionY, SyncPositionZ));
|
||||
@@ -3090,7 +3093,7 @@ namespace Unity.Netcode.Components
|
||||
else
|
||||
{
|
||||
// Non-authority needs to be added to updates for interpolation and applying state purposes
|
||||
m_CachedNetworkManager.NetworkTransformRegistration(this, forUpdate, true);
|
||||
m_CachedNetworkManager.NetworkTransformRegistration(NetworkObject, forUpdate, true);
|
||||
// Remove this instance from the tick update
|
||||
DeregisterForTickUpdate(this);
|
||||
ResetInterpolatedStateToCurrentAuthoritativeState();
|
||||
|
||||
Reference in New Issue
Block a user