在组件中调用 this.destory() 和 this.node.destory() 有什么区别啊

1.在组件中调用 this.destory 和 this.node.destory() 有什么区别啊 ?
2.比如我绑定了一个一个prefab ,这个prefab 是一个cc.Node,定义如下
list:{
default:null,
type:cc.Node
}
我调用 this.list.destory 和 this.list.parent = null; 是不是一个意思啊?是否都会调用子节点 destory,并且回调绑定在子节点上组件的onDestory;
3.比如我这个prefab 是个直接是个继承cc.Component 的 改调用 this.destory 还是 this.node.destory 呢。。还有this.destory() 和 this.parent = null, this.node.destory 和this.node.parent = null; 有什么却别嘛

@jare 11111

1.this.destroy只会销毁本组件,this.node.destroy会销毁这个节点及这个节点的所有组件
2.不是一个意思,destroy需要显式调用才会回调onDestroy
3.=null只是js层面的销毁,但是creator里面很多东西都是用native层实现的,js层只是提供一个调用native层的接口,所以你要销毁东东必须显式调用destroy,否则native层就没法销毁

1赞

parent = null, 相当于 removeFromParent
这个操作不会触发节点销毁,因为你可以重新设置成别的父节点