Ejemplo n.º 1
0
        /// <summary>
        /// Based on the type of animator state info pass it through to the animator
        /// </summary>
        /// <param name="animationParameter"></param>
        protected void SetAnimatorParameter(AnimatorParameter animationParameter)
        {
            // Return if we do not have an animator
            if (CursorAnimator == null)
            {
                return;
            }

            switch (animationParameter.Type)
            {
            case AnimatorControllerParameterType.Bool:
                CursorAnimator.SetBool(animationParameter.NameHash, animationParameter.DefaultBool);
                break;

            case AnimatorControllerParameterType.Float:
                CursorAnimator.SetFloat(animationParameter.NameHash, animationParameter.DefaultFloat);
                break;

            case AnimatorControllerParameterType.Int:
                CursorAnimator.SetInteger(animationParameter.NameHash, animationParameter.DefaultInt);
                break;

            case AnimatorControllerParameterType.Trigger:
                CursorAnimator.SetTrigger(animationParameter.NameHash);
                break;
            }
        }
        /// <summary>
        /// Based on the type of animator state info pass it through to the animator
        /// </summary>
        /// <param name="stateDatum"></param>
        protected void SetAnimatorParameter(AnimatorParameter param)
        {
            // Return if we do not have an animator
            if (CursorAnimator == null)
            {
                return;
            }

            switch (param.type)
            {
            case AnimatorControllerParameterType.Bool:
                CursorAnimator.SetBool(param.nameHash, param.defaultBool);
                break;

            case AnimatorControllerParameterType.Float:
                CursorAnimator.SetFloat(param.nameHash, param.defaultFloat);
                break;

            case AnimatorControllerParameterType.Int:
                CursorAnimator.SetInteger(param.nameHash, param.defaultInt);
                break;

            case AnimatorControllerParameterType.Trigger:
                CursorAnimator.SetTrigger(param.nameHash);
                break;
            }
        }