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

循环里面schedule应该怎么写?

$
0
0

@jiu999jiu999 写道:

想要根据enemyG的个数,设置多个schedule
如下:

for (var ei=0; ei< this.enemyG.length; ei++){
            var freqTime = this.enemyG[ei].freqTime;
            this.schedule(function(){
                this.getNewEnemy(this.enemyG[ei]);
            }, freqTime);
        }

等到第一次执行回调的时候,ei 就不是0了,

帖子: 5

参与者: 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>