Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

ReferenceError: component is not defined

$
0
0

@nyjianzhan 写道:

`cc.Class({
extends: cc.Component,

// use this for initialization
onLoad: function () {
   
},

// called every frame
update: function (dt) {
        // 以秒为单位的时间间隔
         var interval = 5;
         // 重复次数
         var repeat = 3;
         // 开始延时
         var delay = 10;
         component.schedule(function() {
             // 这里的 this 指向 component
             cc.log("aaaaaa")
         }, interval, repeat, delay);
},

});
`

这样运行报错:Simulator: 23:ReferenceError: component is not defined
大神看看怎么回事

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>