adding IsParameterControlledByCurve check (#1547)

This commit is contained in:
James Frowen 2020-03-18 16:30:16 +00:00 committed by GitHub
parent 2d1b142276
commit cf8b979cce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.Serialization;
using System.Linq;
namespace Mirror
{
@ -66,7 +67,9 @@ void Awake()
{
// store the animator parameters in a variable - the "Animator.parameters" getter allocates
// a new parameter array every time it is accessed so we should avoid doing it in a loop
parameters = animator.parameters;
parameters = animator.parameters
.Where(par => !animator.IsParameterControlledByCurve(par.nameHash))
.ToArray();
lastIntParameters = new int[parameters.Length];
lastFloatParameters = new float[parameters.Length];
lastBoolParameters = new bool[parameters.Length];