function scheduleTask(t){cc.director.getScheduler().scheduleUpdateForTarget(t,3,!1);return t}function unscheduleTask(t){cc.director.getScheduler().unscheduleUpdateForTarget(t);return t}qyengine.scheduleTask=scheduleTask;qyengine.unscheduleTask=unscheduleTask;!function(){var t=window.QyTimeline=cc.Class.extend({ctor:function(t){this.setStepProps(t);this.scheduledIdx=null}});t.prototype.setStepProps=function(t){t||(t={});this.stepProps={loop:null!=t.loop?t.loop:!1,delay:t.delay||0,startPosition:t.startPosition||0};return this};t.prototype.stop=function(){if(null!=this.scheduled){qyengine.unscheduleTask(this);this.scheduledIdx=null;if(this.started){this.started=!1;var t=this.startedOpt&&this.startedOpt.bindObj||this.bindObj;t&&t.dispatchEvent("timelinestop")}}return this};t.prototype.start=function(t){if(!this.stepDefs_)return this;this.stop();var e=qyengine.merge(this.stepProps,t);this.startedOpt=e;this._currentStepIdx=0;this._totalTime=0;this.startImm_();return this};t.prototype.startImm_=function(){this.stop();var t=this.startedOpt&&this.startedOpt.bindObj||this.bindObj;t&&t.dispatchEvent("timelinestart");this.started=!0;this.scheduled=qyengine.scheduleTask(this);return this};t.prototype.update=function(t){this._totalTime+=t;if(this.stepDefs_[this._currentStepIdx][0]/100<this._totalTime){this.stepDefs_[this._currentStepIdx][1]();this._currentStepIdx+=1;if(this.stepDefs_.length===this._currentStepIdx)if(this.startedOpt.loop){this._currentStepIdx=0;this._totalTime=0}else this.stop()}}}();