/// <summary> /// 文件类型资源 /// </summary> public AssetInfo(string fullPath, string name, string extension) { AssetFullPath = fullPath; #if UNITY_EDITOR_OSX //之前的代码反正在MAC上是有问题的,不确定Windows上是否正常,所以我这里只改动Mac的。 AssetPath = "Assets/" + fullPath.Replace(Application.dataPath, ""); #else AssetPath = "Assets" + fullPath.Replace(Application.dataPath.Replace("/", "\\"), ""); #endif AssetName = name; Extension = extension; GUID = AssetDatabase.AssetPathToGUID(AssetPath); AssetFileType = EditorTool.GetFileTypeByExtension(extension); AssetType = AssetDatabase.GetMainAssetTypeAtPath(AssetPath); IsChecked = false; IsExpanding = false; Bundled = AssetDatabase.GetImplicitAssetBundleName(AssetPath); ChildAssetInfo = null; AssetBundleInfo.TryAddBundleInfo(this); }