不用的节点要用destroyAllChildren而非removeAllChildren

不然不会调onDestroy,注册的事件也会继续走。

  • removeAllChildren 执行的回调有:onDisable
  • destroyAllChildren 执行的回调有:onDisableonDestroy
posted @ 2024-01-12 14:37  流星曳尾  阅读(22)  评论(0编辑  收藏  举报