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

关于继承

$
0
0

@panli32811 写道:

使用了源码里类似的方式来继承cc.RepeatForever,为嘛step函数不能被调用

var LotteryAction = cc.RepeatForever.extend({
    moveTo: ...,
    rotateBy: ...,
    ctor: function () {
        cc.RepeatForever.prototype.ctor.call(this, cc.spawn(this.moveTo, this.rotateBy));
    },
    step: function (dt) {
        cc.log('step');
...
    },
});

从头至尾都没看到step输出过,这是何解,不能重写step么

帖子: 2

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