mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkTransformUnreliable: UpdateClientInterpolation helper function
This commit is contained in:
parent
6e142d8cc0
commit
5f1ec83cca
@ -227,16 +227,7 @@ void UpdateClientBroadcast()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateClient()
|
void UpdateClientInterpolation()
|
||||||
{
|
|
||||||
// client authority, and local player (= allowed to move myself)?
|
|
||||||
if (IsClientWithAuthority)
|
|
||||||
{
|
|
||||||
UpdateClientBroadcast();
|
|
||||||
}
|
|
||||||
// for all other clients (and for local player if !authority),
|
|
||||||
// we need to apply snapshots from the buffer
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// only while we have snapshots
|
// only while we have snapshots
|
||||||
if (clientSnapshots.Count > 0)
|
if (clientSnapshots.Count > 0)
|
||||||
@ -255,6 +246,20 @@ void UpdateClient()
|
|||||||
Apply(computed, to);
|
Apply(computed, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateClient()
|
||||||
|
{
|
||||||
|
// client authority, and local player (= allowed to move myself)?
|
||||||
|
if (IsClientWithAuthority)
|
||||||
|
{
|
||||||
|
UpdateClientBroadcast();
|
||||||
|
}
|
||||||
|
// for all other clients (and for local player if !authority),
|
||||||
|
// we need to apply snapshots from the buffer
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UpdateClientInterpolation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnSerialize(NetworkWriter writer, bool initialState)
|
public override void OnSerialize(NetworkWriter writer, bool initialState)
|
||||||
|
Loading…
Reference in New Issue
Block a user