Skip to content

Commit 7f90dbc

Browse files
update
Implementing suggested changes.
1 parent 580ac90 commit 7f90dbc

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,11 @@ public bool IsServerAuthoritative()
669669
/// </remarks>
670670
protected virtual bool OnIsServerAuthoritative()
671671
{
672-
return m_LocalNetworkManager && m_LocalNetworkManager.DistributedAuthorityMode ? true : AuthorityMode == AuthorityModes.Server;
672+
if (m_LocalNetworkManager && m_LocalNetworkManager.DistributedAuthorityMode)
673+
{
674+
return true;
675+
}
676+
return AuthorityMode == AuthorityModes.Server;
673677
}
674678

675679
private int[] m_TransitionHash;
@@ -760,10 +764,7 @@ protected virtual void Awake()
760764

761765
foreach (var parameterEntry in AnimatorParameterEntries.ParameterEntries)
762766
{
763-
if (!AnimatorParameterEntryTable.ContainsKey(parameterEntry.NameHash))
764-
{
765-
AnimatorParameterEntryTable.Add(parameterEntry.NameHash, parameterEntry);
766-
}
767+
AnimatorParameterEntryTable.TryAdd(parameterEntry.NameHash, parameterEntry);
767768
}
768769

769770
int layers = m_Animator.layerCount;
@@ -1692,8 +1693,8 @@ private void InternalSetTrigger(int hash, bool isSet = true)
16921693
}
16931694

16941695
/// <summary>
1695-
/// Distributed Authority: Internally-called RPC client receiving function to update a trigger when the server wants to forward
1696-
/// a trigger to a client
1696+
/// Distributed Authority: Internally-called RPC client receiving function to update a trigger when the authority wants
1697+
/// to forward a trigger to a client
16971698
/// </summary>
16981699
/// <param name="animationTriggerMessage">the payload containing the trigger data to apply</param>
16991700
[Rpc(SendTo.NotAuthority, AllowTargetOverride = true, InvokePermission = RpcInvokePermission.Owner)]

0 commit comments

Comments
 (0)