[置顶] 【Unity3D游戏开发】`UnityEditor' could not be found Are you missing a using directive ... (二九)

`UnityEditor' could not be found Are you missing a using directive or an assembly reference? 

using UnityEditor; 之后无法Building,会出错 .

using UnityEditor;   之后无法Build,出错,不导出时在编辑器里是没有报错的,运行也正常,导出时,却提示
error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?


解答:Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。

你可能感兴趣的:(assembly,Missing,found,unityeditor,be,not)