private IEnumerator VariableChanged(VariableValue value, BindingAnimationStatus status) { status.Increment(); _value = value; CompositionManager.Instance.RunInstruction(Graph, Variables, VariableValue.Create(gameObject)); while (Graph.IsRunning) { yield return(null); } status.Decrement(); }
public override void UpdateBinding(IVariableStore variables, BindingAnimationStatus status) { status?.Increment(); var value = GetValue(variables); if (Speed <= 0) { SetValue(value); status?.Decrement(); } else { StartCoroutine(AnimateValue(value, status)); } }
public override void UpdateBinding(IVariableStore variables, BindingAnimationStatus status) { status?.Increment(); var fill = GetFill(variables); if (Speed <= 0.0f) { SetFill(fill); status?.Decrement(); } else { StartCoroutine(AnimateFill(fill, status)); } }
private IEnumerator AnimateFill(float target, BindingAnimationStatus status) { status.Increment(); while (_image.fillAmount != target) { var delta = UseScaledTime ? Time.deltaTime : Time.unscaledDeltaTime; var speed = Speed * delta; var fill = Mathf.MoveTowards(_image.fillAmount, target, speed); SetFill(fill); yield return(null); } status.Decrement(); }