Custom Animation Handler Function
In addition to relying on Milease to compute animation operations, you can insert a custom animation handler function at any point:
text.Milease((e) =>
{
e.Target.text = $"Current animation progress: {e.Progress:P}...";
}, [resetFunction], [duration], [offset], [easeFunction], [easeType])
Milease will process the animation progress using the provided easeFunction
and easeType
, and then pass it to your custom handler function.
The custom handler function receives a MilHandleFunctionArgs
context, which includes:
Progress
: Animation progress (0–1)Target
: The target object specified when constructing the animationAnimation
: Additional animation-related informationAnimator
: The associated animation controller
info
-
During a reset operation, the custom handler function will invoke the
resetFunction
. You must implement the reset logic within this function. Ifnull
is passed, no operation will be performed during reset. -
If you need to use the same
handleFunction
for a specific class of objects or properties, refer to Custom Converters.