浏览代码

Update animation_controller.

/main
Yuncong Zhang 5 年前
当前提交
8ca6dff9
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 12
      Runtime/animation/animation_controller.cs

12
Runtime/animation/animation_controller.cs


D.assert(max >= min);
D.assert(max <= this.upperBound && min >= this.lowerBound);
D.assert(reverse != null);
return this.animateWith(new _RepeatingSimulation(this._value, min.Value, max.Value, reverse, period.Value));
}

public TickerFuture animateWith(Simulation simulation) {
D.assert(
this._ticker != null,
"AnimationController.animateWith() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
this.stop();
return this._startSimulation(simulation);
}

}
public void stop(bool canceled = true) {
D.assert(
this._ticker != null,
"AnimationController.stop() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
this._simulation = null;
this._lastElapsedDuration = null;
this._ticker.stop(canceled: canceled);

this._max = max;
this._periodInSeconds = (float) period.Ticks / TimeSpan.TicksPerSecond;
this._initialT = (max == min) ? 0.0f : (initialValue / (max - min)) * (period.Ticks / TimeSpan.TicksPerSecond);
this._reverse = reverse;
D.assert(this._periodInSeconds > 0.0f);
D.assert(this._initialT >= 0.0f);
}

正在加载...
取消
保存