/// <summary> /// 创建指定文件夹中的assetbundle /// </summary> /// <param name="assetPath">资源的项目路径</param> /// <param name="outputPath">输出路径(fullPath)</param> /// <param name="suffixs">要求的后缀</param> public static void BuildPartABs(string assetPath, string outputPath, string[] suffixs = null) { List <string> paths = SystemIOTool.GetTargetPaths(assetPath, false, suffixs); BuildTargetAB(paths, outputPath); EditorUtility.ClearProgressBar(); }
private static void SetReadWrite(bool isEnable) { models = SystemIOTool.GetTargetPaths(EditorTool.GetSelectionPath(), false, modelSuffix); for (int i = 0; i < models.Count; i++) { EditorUtility.DisplayProgressBar("SetRead&Write", "设置模型的Read&Write属性", 1f * i / models.Count); ModelImporter m = AssetImporter.GetAtPath(models[i]) as ModelImporter; m.isReadable = isEnable; AssetDatabase.ImportAsset(models[i]); } EditorUtility.ClearProgressBar(); }
/// <summary> /// 清空资源的AssetBundle名字 /// </summary> public static void ClearABName() { string folderPath = EditorTool.GetSelectionPath(true); List <string> paths = SystemIOTool.GetTargetPaths(folderPath); int count = paths.Count; for (int i = 0; i < paths.Count; i++) { EditorUtility.DisplayProgressBar("EditorHelper", "Clearing AssetBundle Names", 1f * i / count); SetABName(paths[i], null); } AssetDatabase.RemoveUnusedAssetBundleNames(); EditorUtility.ClearProgressBar(); }
/// <summary> /// 设置MipMaps /// </summary> private static void SetMipMaps(bool isOpen) { texs = SystemIOTool.GetTargetPaths(EditorTool.GetSelectionPath(), false, texSuffix); for (int i = 0; i < texs.Count; i++) { EditorUtility.DisplayProgressBar("SetMipMaps", "设置贴图的MipMaps属性", 1f * i / texs.Count); TextureImporter t = AssetImporter.GetAtPath(texs[i]) as TextureImporter; t.mipmapEnabled = isOpen; TextureImporterSettings tis = new TextureImporterSettings(); t.ReadTextureSettings(tis); tis.ApplyTextureType(tis.textureType); t.SetTextureSettings(tis); AssetDatabase.ImportAsset(texs[i]); } EditorUtility.ClearProgressBar(); }