mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkAnimator: OnSerialize syntax
This commit is contained in:
parent
275d5ad797
commit
7c87da9bc7
@ -375,18 +375,11 @@ public override void OnSerialize(NetworkWriter writer, bool initialState)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < animator.layerCount; i++)
|
for (int i = 0; i < animator.layerCount; i++)
|
||||||
{
|
{
|
||||||
if (animator.IsInTransition(i))
|
AnimatorStateInfo st = animator.IsInTransition(i)
|
||||||
{
|
? animator.GetNextAnimatorStateInfo(i)
|
||||||
AnimatorStateInfo st = animator.GetNextAnimatorStateInfo(i);
|
: animator.GetCurrentAnimatorStateInfo(i);
|
||||||
writer.WriteInt(st.fullPathHash);
|
writer.WriteInt(st.fullPathHash);
|
||||||
writer.WriteFloat(st.normalizedTime);
|
writer.WriteFloat(st.normalizedTime);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AnimatorStateInfo st = animator.GetCurrentAnimatorStateInfo(i);
|
|
||||||
writer.WriteInt(st.fullPathHash);
|
|
||||||
writer.WriteFloat(st.normalizedTime);
|
|
||||||
}
|
|
||||||
writer.WriteFloat(animator.GetLayerWeight(i));
|
writer.WriteFloat(animator.GetLayerWeight(i));
|
||||||
}
|
}
|
||||||
WriteParameters(writer, initialState);
|
WriteParameters(writer, initialState);
|
||||||
|
Loading…
Reference in New Issue
Block a user