Introduced global variable while deserializing scene by using new scripts: xxx

我在自定义 CC.Component 时,在构造函数 ctor 中使用 window.xxx 定义了一个全局变量,然后编辑器抛出了这个警告,请问是为什么?如何解?

同问同问