对象池里面调用callFunc的一个问题

enerateNode: function () {
var monster = this._pool.get();
if (!monster) {
monster = cc.instantiate(this.prefab);
// Add pool handler component which will control the touch event
monster.addComponent(‘PoolHandler’);

    }
    
    monster.x = this.regionOrigin.x + Math.floor(Math.random() * this.regionSize.width);
    monster.y = this.regionOrigin.y + Math.floor(Math.random() * this.regionSize.height);
    
    var angle = Math.random() * Math.PI * 2;
    var dx = 500 * Math.cos(angle);
    var dy = 500 * Math.sin(angle);
    
    monster.runAction(cc.sequence(
        cc.moveBy(5, dx, dy),
        cc.callFunc(**this.removeNode**, this, monster) //这里面的回调函数没有传参数
    ));
    this.node.addChild(monster);
},

removeNode: function (sender, monster) { //这里面传了参数,请问是怎么实现的?
    this._pool.put(monster); //
    console.log(sender);// 这个是monsterPreFab
    console.log(monster);//这个也是monsterPreFab, 并没有指定实参, 为什么会有参数传进来?为啥都一样?既然一样,为什么要传两个参数?是不是文档里面还有没有说明的地方?问题太多了啊。

第一个参数 sender 代表派发这次事件的原始节点,由于 monster 是 action 的运行主体,所以自然 sender 也是它。

第二个参数就是你在 cc.callFunc 中传递的第三个附加参数:

http://cocos.com/docs/creator/api/modules/cc.html#method_callFunc

哦,结合文档看了下,好像是懂了,谢谢熊猫大师。