Unity5 Android编译异常记录

1.The type or namespace name `UnityEditor' could not be found.

打包Android的工程的时候出现UnityEditor找不到的异常,造成异常的原因是在非Editor文件下的脚本建立了UnityEditor的引用,错误很低级额。。。
UnityEditor不会编译到可运行的程序中,所以编译的时候会找不到这个引用,主要用在辅助于inspector窗口开发,使用的脚本为了避免这个异常需要将脚本放在Editor为命名的目录下

顺带再记录下Unity脚本编译的顺序(非打包编译):
Phase 1: Standard Assets, Pro Standard Assets and Plugins 文件夹中的运行时脚本
Phase 2: Standard Assets, Pro Standard Assets and Plugins 中的Editor目录下的脚本
Phase 3: 其他的剩余部分且不在Editor目录下的脚本
Phase 4: 剩余的Editor目录下的脚本

你可能感兴趣的:(Unity5 Android编译异常记录)