美文网首页
cocos creator 自定义类使用schedule

cocos creator 自定义类使用schedule

作者: 凡凡的小web | 来源:发表于2025-03-13 11:04 被阅读0次
image.png
private _scheduler: Scheduler = null

    init(){
        Scheduler.enableForTarget(this)
        this._scheduler = director.getScheduler()
    }

    update(){

    }

      startCheck(){
       director.on(Director.EVENT_BEFORE_DRAW, this.checkProfile, this);
        this._scheduler.schedule(this.checked, this, 10)    
      }

      checked(){
     this._scheduler.unschedule(this.checked, this)
      director.off(Director.EVENT_BEFORE_DRAW, this.checkProfile, this);
        }

checkProfile(){
}

相关文章

网友评论

      本文标题:cocos creator 自定义类使用schedule

      本文链接:https://www.haomeiwen.com/subject/jcbvmjtx.html