creator 如何使用计时器呢?

参考计时器的API文档 写了下面的倒计时的实现

var xxxUtils = require("XXUtils");

cc.Class({
    extends: cc.Component,

    properties: {
        level:{
            type: cc.Label,
            default: null
        },

        timeDesp:{
            type: cc.Label,
            default: null
        },

        timeRemain: 60
    },

    timeInsufficient: function(){
        console.log(" time Insufficient");
    },

    countDown: function(){
        if(this.timeRemain <= 0){

            this.timeInsufficient();
            this.unschedule(this.countDown);

        }
        this.timeRemain --;
        this.timeDesp.string = xxxUtils.toTimeStr(this.timeRemain);
    },

    onLoad: function(){
        console.log("onload ...");
        this.level.string = 2 + "";
        this.timeDesp.string = xxxUtils.toTimeStr(this.timeRemain);
        component.schedule(this.countDown, 1);
       // this.timeDesp.string = "1:00";
    },
});

为什么不能用呢? 提示 component不存在

this.schedule(this.countDown, 1);

建议官方还是尽量不要在文档里用伪代码,比如这里的component,还不如直接写个完整的类,用this.schedule来代替,防止小白看不懂。