Skip to content

fix: NetworkAnimator now uses owner NetworkManager #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions com.unity.multiplayer.mlapi/Prototyping/NetworkAnimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void FixedUpdate()

private bool CheckSendRate()
{
var networkTime = NetworkManager.Singleton.NetworkTime;
var networkTime = NetworkManager.NetworkTime;
if (SendRate != 0 && m_NextSendTime < networkTime)
{
m_NextSendTime = networkTime + SendRate;
Expand Down Expand Up @@ -223,8 +223,8 @@ private void SendTrackedParams()
{
Send = new ClientRpcSendParams
{
TargetClientIds = NetworkManager.Singleton.ConnectedClientsList
.Where(c => c.ClientId != NetworkManager.Singleton.ServerClientId)
TargetClientIds = NetworkManager.ConnectedClientsList
.Where(c => c.ClientId != NetworkManager.ServerClientId)
.Select(c => c.ClientId)
.ToArray()
}
Expand All @@ -247,8 +247,8 @@ private void SendAllParamsAndState(int animStateHash, float animStateTime)
{
Send = new ClientRpcSendParams
{
TargetClientIds = NetworkManager.Singleton.ConnectedClientsList
.Where(c => c.ClientId != NetworkManager.Singleton.ServerClientId)
TargetClientIds = NetworkManager.ConnectedClientsList
.Where(c => c.ClientId != NetworkManager.ServerClientId)
.Select(c => c.ClientId)
.ToArray()
}
Expand Down Expand Up @@ -277,7 +277,7 @@ private void UpdateTrackedParamsServerRpc(AnimParams animParams, ServerRpcParams
{
Send = new ClientRpcSendParams
{
TargetClientIds = NetworkManager.Singleton.ConnectedClientsList
TargetClientIds = NetworkManager.ConnectedClientsList
.Where(c => c.ClientId != serverRpcParams.Receive.SenderClientId)
.Select(c => c.ClientId)
.ToArray()
Expand Down Expand Up @@ -311,7 +311,7 @@ private void UpdateAnimStateServerRpc(int animStateHash, float animStateTime, Se
{
Send = new ClientRpcSendParams
{
TargetClientIds = NetworkManager.Singleton.ConnectedClientsList
TargetClientIds = NetworkManager.ConnectedClientsList
.Where(c => c.ClientId != serverRpcParams.Receive.SenderClientId)
.Select(c => c.ClientId)
.ToArray()
Expand Down