From c69ae75d6a541ee7ade90e4cf87a401df694e11b Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Tue, 24 Mar 2020 13:47:10 -0500 Subject: [PATCH] simplify parameter change --- Assets/Mirror/Components/NetworkAnimator.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Assets/Mirror/Components/NetworkAnimator.cs b/Assets/Mirror/Components/NetworkAnimator.cs index 2bf850cbe..3376cf61e 100644 --- a/Assets/Mirror/Components/NetworkAnimator.cs +++ b/Assets/Mirror/Components/NetworkAnimator.cs @@ -221,28 +221,19 @@ ulong NextDirtyBits() { int newIntValue = animator.GetInteger(par.nameHash); changed = newIntValue != lastIntParameters[i]; - if (changed) - { - lastIntParameters[i] = newIntValue; - } + lastIntParameters[i] = newIntValue; } else if (par.type == AnimatorControllerParameterType.Float) { float newFloatValue = animator.GetFloat(par.nameHash); changed = Mathf.Abs(newFloatValue - lastFloatParameters[i]) > 0.001f; - if (changed) - { - lastFloatParameters[i] = newFloatValue; - } + lastFloatParameters[i] = newFloatValue; } else if (par.type == AnimatorControllerParameterType.Bool) { bool newBoolValue = animator.GetBool(par.nameHash); changed = newBoolValue != lastBoolParameters[i]; - if (changed) - { - lastBoolParameters[i] = newBoolValue; - } + lastBoolParameters[i] = newBoolValue; } if (changed) {