Example #1
0
        /// <summary>
        /// Updates a given parameter in the character animator
        /// </summary>
        /// <param name="characterAnimator"></param>
        public void Update(StratusCharacterAnimator characterAnimator)
        {
            switch (parameterType)
            {
            case AnimatorControllerParameterType.Float:
                characterAnimator.SetFloat(parameterName, member.Get <float>());
                break;

            case AnimatorControllerParameterType.Int:
                characterAnimator.SetInteger(parameterName, member.Get <int>());
                break;

            case AnimatorControllerParameterType.Bool:
                characterAnimator.SetBoolean(parameterName, member.Get <bool>());
                break;
            }
        }
Example #2
0
        public void Play(StratusCharacterAnimator ca)
        {
            switch (parameterType)
            {
            case AnimatorControllerParameterType.Float:
                ca.SetFloat(parameter.name, floatValue);
                break;

            case AnimatorControllerParameterType.Int:
                ca.SetInteger(parameter.name, intValue);
                break;

            case AnimatorControllerParameterType.Bool:
                ca.SetBoolean(parameter.name, boolValue);
                break;

            case AnimatorControllerParameterType.Trigger:
                ca.SetTrigger(parameter.name);
                break;
            }
        }