From c360c54a1b998b999611dac340cf6f066fc7ccdc Mon Sep 17 00:00:00 2001 From: Chuan Liu Date: Sat, 7 Nov 2020 16:06:24 +0000 Subject: [PATCH] Fixed an issue that CurrentValue isn't set to "From" if the animation never started. --- Scripts/CustomAnimation.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/CustomAnimation.cs b/Scripts/CustomAnimation.cs index 29225e1..cede02a 100644 --- a/Scripts/CustomAnimation.cs +++ b/Scripts/CustomAnimation.cs @@ -32,7 +32,7 @@ public CustomAnimation(Action customUpdate, float from = 0, float to = 1. : base((GameObject)null, duration, easingFunction) { this.customUpdate = customUpdate ?? throw new ArgumentNullException(nameof(customUpdate)); - From = from; + From = CurrentValue = from; To = to; } @@ -74,7 +74,7 @@ public CustomAnimation(T target, Action customUpdate, float from = 0, { Target = target; this.customUpdate = customUpdate ?? throw new ArgumentNullException(nameof(customUpdate)); - From = from; + From = CurrentValue = from; To = to; }