void Done() { Time?.Invoke(1f); Cur?.Invoke(_to); OnDone?.Invoke(); _timer = null; }
public bool Update(float dt) { if (null != _delay) { bool isDelayed = _delay.UpdateTimer(dt); if (isDelayed) { // return true if its being delayed return(true); } else { _delay = null; OnStart?.Invoke(); } } if (null != _timer) { if (_timer.UpdateTimer(dt)) { float t = _timer.GetPercentage(); Vector2 cur = Quadratic(_from, _control, _to, t); // notify Time?.Invoke(t); Cur?.Invoke(cur); // return true since it's still updating return(true); } else { Done(); } } return(false); }