protected override void DoUpdate(SAMTime gameTime, InputState istate) { switch (_mode) { case 0: _progress += gameTime.ElapsedSeconds / TIME_APPEAR; RelativeCenter = _start; if (_progress >= 1) { _progress = 0; _mode++; } break; case 1: _progress += gameTime.ElapsedSeconds / TIME_STARTWAIT; RelativeCenter = _start; if (_progress >= 1) { _progress = 0; _mode++; } break; case 2: _progress += gameTime.ElapsedSeconds / TIME_MOVE; RelativeCenter = FPoint.Lerp(_start, _end, FloatMath.FunctionEaseInOutCubic(_progress)); if (_progress >= 1) { _progress = 0; _mode++; } break; case 3: _progress += gameTime.ElapsedSeconds / TIME_ENDWAIT; RelativeCenter = _end; if (_progress >= 1) { _progress = 0; _mode++; } break; case 4: _progress += gameTime.ElapsedSeconds / TIME_DISAPPEAR; RelativeCenter = _end; if (_progress >= 1) { _progress = 0; _mode++; } break; case 5: _progress += gameTime.ElapsedSeconds / TIME_DEAD; if (_progress >= 1) { _progress = 0; _mode = 0; } break; default: SAMLog.Error("HTA::EnumSwitch_DU", "value: " + _mode); break; } }
protected override void DoUpdate(SAMTime gameTime, InputState istate) { _progress += gameTime.ElapsedSeconds; RelativePosition = FPoint.Lerp(_p1, _p2, FloatMath.PercSin(_progress / 0.5f)); }