Commit 81015676 authored by rockyl's avatar rockyl

loop实现

parent d9b0f870
...@@ -84,17 +84,17 @@ export default class Wave extends ScillaComponent { ...@@ -84,17 +84,17 @@ export default class Wave extends ScillaComponent {
const {duration, waveParams, _waveMethod, transform, transform: {position, scale}, _oldProps} = this; const {duration, waveParams, _waveMethod, transform, transform: {position, scale}, _oldProps} = this;
let pass = (t - this._startTime) % duration;
let r = pass / duration * PI2;
let loopCounting = Math.floor((t - this._startTime) / duration); let loopCounting = Math.floor((t - this._startTime) / duration);
if(loopCounting != this._loopCounting){ if(loopCounting != this._loopCounting){
this._loopCounting = loopCounting; this._loopCounting = loopCounting;
if(this.onLoopEnd()){ if(this.onLoopEnd()){
return; r = PI2;
} }
} }
let pass = (t - this._startTime) % duration;
let r = pass / duration * PI2;
let params = waveParams || []; let params = waveParams || [];
let props = _waveMethod(...params, r); let props = _waveMethod(...params, r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment