CUIAnimation , WIP implementation of animations
It's an object that contains animation state and performs the animation
It can animate any property on any object
Active animations are added to CUIAnimation.ActiveAnimations and updated in CUIUpdate
Properties:
- Target - Target object that contains animated property
- Property - Target property name
- Lambda - Current animation progress [0..1]
- StartValue, EndValue - Values between which property is animated
- Duration, ReverseDuration - how long it takes to run the animation
- Speed, ReverseSpeed - Lambda step per tick
- Direction - Enum, direction in which animation progresses [Straight, Reverse]
- Blocked - Prevents it from starting
- Bounce - Will reverse direction instead of endting the animation
- Action<CUIDirection> OnStop - event that happens when animation ends
- Func<float, object> Interpolate - Custom interpolate function, if not set then matching function for Property type in CUIInterpolate is used
Methods:
- Start() - Resumes the animation is same direction
- Stop() - Stops the animation
- Forward() - Starts the animation in Straight direction
- Back() - Starts the animation in Reverse direction
- SetToStart() - Sets Lambda to 0
- SetToEnd() - Sets Lambda to 1