1 先检查引用问题
2 如果引用没有问题,那就是没有参照下面:
Unity发布时出现“The type or namespace name `UnityEditor' could not be found.” 错误
这说明是编辑器脚没有放到目录文件夹 Assets/Editor的目录下。
如果是想在在非编辑器脚本中加入UnityEditor的相关代码,需要这样:
#if UNITY_EDITOR
//用到编辑器的代码
#endif
例如:
1 先检查引用问题
2 如果引用没有问题,那就是没有参照下面:
Unity发布时出现“The type or namespace name `UnityEditor' could not be found.” 错误
这说明是编辑器脚没有放到目录文件夹 Assets/Editor的目录下。
如果是想在在非编辑器脚本中加入UnityEditor的相关代码,需要这样:
#if UNITY_EDITOR
//用到编辑器的代码
#endif
例如: