public void Reset()
    {
        Animator animparam = GetComponent <Animator> ();

        UnityEditorInternal.AnimatorController controller = animparam.runtimeAnimatorController as UnityEditorInternal.AnimatorController;
        parameterInfos = new AnimatorParameterInfo[controller.parameterCount];

        for (int i = 0; i < controller.parameterCount; i++)
        {
            var param = controller.GetParameter(i);
            parameterInfos [i].hashName = Animator.StringToHash(controller.GetParameter(i).name);

            if (param.type == UnityEditorInternal.AnimatorControllerParameterType.Bool)
            {
                parameterInfos [i].type = ResumeAnimator.AnimatorParameterInfo.ParameterType.BOOL;
            }
            else if (param.type == UnityEditorInternal.AnimatorControllerParameterType.Float)
            {
                parameterInfos [i].type = ResumeAnimator.AnimatorParameterInfo.ParameterType.FLOAT;
            }
            else if (param.type == UnityEditorInternal.AnimatorControllerParameterType.Int)
            {
                parameterInfos [i].type = ResumeAnimator.AnimatorParameterInfo.ParameterType.INT;
            }
            else if (param.type == UnityEditorInternal.AnimatorControllerParameterType.Trigger)
            {
                parameterInfos [i].type = ResumeAnimator.AnimatorParameterInfo.ParameterType.TRIGGER;
            }
        }
    }
 public static IEnumerable <UnityEditorInternal.AnimatorControllerParameter> EnumerateParameters(this UnityEditorInternal.AnimatorController ac)
 {
     for (int i = 0; i < ac.parameterCount; ++i)
     {
         yield return(ac.GetParameter(i));
     }
 }