@property(cc.Node)
man: cc.Node = null;
onLoad () {
let that=this;
that.playanim();
that.node.on(cc.Node.EventType.TOUCH_START, that.touch_start, that.node)
that.node.on(cc.Node.EventType.TOUCH_END, that.touch_end, that.node)
}
//点击事件
touch_start(){
let seq = cc.moveBy(0.5, 0, this.jump_height);
this.man.runAction(seq);
//错误提示Uncaught TypeError: Cannot read property ‘runAction’ of undefined。
cc.find(‘Canvas/man’).runAction(seq);//这个就正确!
}
当前脚本是直接挂在canvas上的,节点也拖进去了!这是为什么呢
