unity 出现问题 The type or namespace name `AssetDatabase' does not exist in the namespace `UnityEditor'. Are you missing an assembly reference?
参考资料1解决办法
使用UnityEditor库的变量,由于UnityEditor只存在Unity编辑器中,建立EXE的时候,会报错
using UnityEditor;
应该写为
#if UNITY_EDITOR
using UnityEditor;
#endif
以相关资料1 的出现的错误为例子,进行纠正
Test_FindFiles.cs的findFiles001()函数中的代码为
//获得 工程文件的路径,以及要 加载的目标文件夹下面的 文件路径,存放在一个字符串数组中
string[] arrStrAudioPath = Directory.GetFiles(Application.dataPath + "/123/asset/", "*", SearchOption.AllDirectories);//using System.IO;
FileInfo file;
//循环遍历每一个路径,单独加载
foreach (string strAudioPath in arrStrAudioPath)
{
//替换路径中的反斜杠为正斜杠
str