/// <summary> /// This is callled when this commponent is reset. /// </summary> public override void Reset() { base.Reset(); targetProperty = Defaults.targetProperty; targetAnimation = Defaults.targetAnimation; }
/// <summary> /// This function is used to help set basic properties on a animation state /// in a generic way. /// </summary> /// <param name="animationState">The animation state whose properties are to be set.</param> /// <param name="targetProperty">The target property to set.</param> /// <param name="propertyValue">The value to set the target property to.</param> public static void SetAnimationStateProperty(AnimationState animationState, AnimationStateProperty targetProperty, float propertyValue) { //check if the animation is null if (animationState == null) { return; } //set the property switch (targetProperty) { case AnimationStateProperty.Speed: animationState.speed = propertyValue; break; case AnimationStateProperty.NormalizedTime: animationState.normalizedTime = propertyValue; break; case AnimationStateProperty.Weight: animationState.weight = propertyValue; break; default: break; } }