diff --git a/Assets/Mirror/Components/NetworkAnimator.cs b/Assets/Mirror/Components/NetworkAnimator.cs index 87b1efcf9..295afccff 100644 --- a/Assets/Mirror/Components/NetworkAnimator.cs +++ b/Assets/Mirror/Components/NetworkAnimator.cs @@ -375,18 +375,11 @@ public override void OnSerialize(NetworkWriter writer, bool initialState) { for (int i = 0; i < animator.layerCount; i++) { - if (animator.IsInTransition(i)) - { - AnimatorStateInfo st = animator.GetNextAnimatorStateInfo(i); - writer.WriteInt(st.fullPathHash); - writer.WriteFloat(st.normalizedTime); - } - else - { - AnimatorStateInfo st = animator.GetCurrentAnimatorStateInfo(i); - writer.WriteInt(st.fullPathHash); - writer.WriteFloat(st.normalizedTime); - } + AnimatorStateInfo st = animator.IsInTransition(i) + ? animator.GetNextAnimatorStateInfo(i) + : animator.GetCurrentAnimatorStateInfo(i); + writer.WriteInt(st.fullPathHash); + writer.WriteFloat(st.normalizedTime); writer.WriteFloat(animator.GetLayerWeight(i)); } WriteParameters(writer, initialState);