public bool Animate() { float delta_time = step_timer.RestartGetSeconds(); if (is_animating && delta_time > 0.0f) { current_value = operation(current_value, target_value, delta_time); if (current_value.IsApproximatelyEqual(target_value)) { sleep_timer.Start(); if (sleep_timer.IsTimeOver()) { return(DoDone()); } } else { sleep_timer.StopClear(); } OnAnimate.InvokeAll(); } return(is_animating); }
public void ForceDone() { is_animating = false; sleep_timer.StopClear(); current_value = target_value; OnAnimate.InvokeAll(); OnDone.InvokeAll(); }
public void InvokeAnimation(string name, bool b) { OnAnimate?.Invoke(name, b); an.SetBool(name, b); }