void ITweenUpdate.Update(float deltaTime) { if (_owner == null) { Kill(); return; } if (_delay != null) { _delay.Update(deltaTime); if (_delay.IsAlive) { return; } float overFlow = _delay.OverFlow; _delay.Dispose(); _delay = null; if (Math.Abs(overFlow) < float.Epsilon) { return; } _time += overFlow; } else { _time += deltaTime; } if (_time < _duration) { float t = _time / _duration; float tEased = Easing.Interpolate(t, _ease); _state.Update(tEased); Try(_onUpdate); } else { OnTweenComplete(); } }
void ITweenUpdate.Dispose() { _delay?.Dispose(); _state.Dispose(); TweenPool.Tweens.Recycle(this); }