public static void UpdateColor(UIWidget widget) { TweenColor tweenColor = widget.gameObject.AddComponent <TweenColor>(); if (null == tweenColor) { throw new MissingComponentException(); } tweenColor.from = widget.color; //GetHighlightColorByTimeState(Instance.PreviousTimeState); tweenColor.to = GetCurrentTextColor(); tweenColor.delay = 1f; tweenColor.duration = AnimationDuration; if (null == EasyInOutAnimCurve) { Instance.InitAnimationCurve(); } tweenColor.animationCurve = EasyInOutAnimCurve; tweenColor.SetOnFinished(() => Destroy(tweenColor)); }