菜鸟问题,示例代码中为什么要使用node

刚刚在读cocos creator的教学文档,其中“快速上手: 制作第一个游戏”中有如下示例代码:

这里用到了一些 Cocos2d-js 引擎中的 Action 来实现主角的跳跃动画,详情可以查询Cocos2d-js API.接下来在onLoad方法里调用刚添加的setJumpAction方法,然后执行runAction来开始动作:// Player.js
onLoad: function () {
// 初始化跳跃动作
this.jumpAction = this.setJumpAction();
this.node.runAction(this.jumpAction);
},

请问在调用runAction方法是为什么要加个node,this.runAction(this.jumpAction)不可以吗?

this只得是这个脚本组件, this.node才是获得绑定this组件的节点
具体可以看这个文档 http://www.cocos.com/docs/creator/scripting/access-node-component.html

谢谢啦:grin: