scene加载Canvas冲突

Can’t init canvas ‘Canvas’ because it conflicts with the existing ‘Canvas’, the scene should only have one active canvas at the same time

嗯,当前场景只能有一个 Canvas

我是用cc.director.loadScene(“Main”)来切换场景的,在一个scene的button被点击调用这个代码,这样为什么会出现两个Canvas呢?

因为你前一个场景的 Canvas 可能作为了 persistRootNode 没有销毁

问题解决,谢谢,是挂了一个关于全局数据的脚本在Canvas上,导致切场景时这个Canvas消不掉吧