以下代码标注黑体那行,就是切换PARENT时不起作用,但是只要不放在tween中单独执行就没问题。断点跟踪“this.node3.parent = this.topNode”这行,居然node3的parent 还是没有变,是以前的parent ,而不是topNode
@property(cc.Node)
node3: cc.Node = null;
@property(cc.Node)
node2: cc.Node = null;
private topNode:cc.Node
onLoad() {
this.topNode = cc.find("Canvas/Main Camera/bbb/topnode")
cc.director.on("bbbbb", this.changeParent, this)
}
private changeParent() {
**this.node3.parent = this.topNode**
console.log("777777777")
}
start() {
cc.tween(this.node3).to(1, { x: 50, y: 100 }).call(() => { cc.director.emit("bbbbb") }).start()
}