想去继承action,修改update,“extends” simulator 会报错。谁能解释下问什么吗?
method 1 works on native and web:
var count_dt = 0;
const circleMoveBy = cc.MoveBy.extend({
update: function(dt) {
count_dt++;
if (count_dt % 60 == 0)
cc.log("count_dt " + count_dt);
this._super(dt);
},
});
method 2: not work on Native
var count_dt = 0;
const circleMoveBy = cc.Class({
extends: cc.MoveBy,
update: function(dt) {
count_dt++;
if (count_dt % 60 == 0)
cc.log("count_dt " + count_dt);
this._super(dt);
},
});
14:00:23.004Z - normal: Simulator: jsb: ERROR: File /Users/nantas/fireball-x/cxp/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp: Line: 26146, Function: js_cocos2dx_ActionManager_addAction
14:00:23.004Z - normal: Simulator: Invalid Native Object