public static void UnMarkQABForAllSubAssets() { var path = MouseSelector.GetSelectedPathOrFallback(); var childpaths = Directory.GetFiles(path); foreach (var childpath in childpaths) { Debug.Log(">>>>>> UnMark QAB: " + childpath); if (childpath.EndsWith(".meta")) { continue; } var ai = AssetImporter.GetAtPath(childpath); var obj = AssetDatabase.LoadAssetAtPath(childpath, typeof(Object)); RemoveUselessLabels(obj); var labels = AssetDatabase.GetLabels(obj).ToList(); foreach (var lb in labels) { if (lb == LABEL_AB) { labels.Remove(lb); AssetDatabase.SetLabels(obj, labels.ToArray()); break; } } Menu.SetChecked(Mark_AssetBundle, false); ai.assetBundleName = null; AssetDatabase.RemoveUnusedAssetBundleNames(); ResetQMark(childpath); } }
private static void MakePackage() { var path = MouseSelector.GetSelectedPathOrFallback(); if (!string.IsNullOrEmpty(path)) { if (Directory.Exists(path)) { var installPath = MakeInstallPath(); new PackageVersion { InstallPath = installPath, Version = "v0.0.0", IncludeFileOrFolders = new List <string>() { // 去掉最后一个元素 installPath.Remove(installPath.Length - 1) } }.Save(); AssetDatabase.Refresh(); } } }
public static void UnMarkQABForAllSubFolder() { string path = MouseSelector.GetSelectedPathOrFallback(); string[] childpaths = Directory.GetDirectories(path); for (int i = 0; i < childpaths.Length; i++) { Debug.Log(">>>>>> UnMark QAB: " + childpaths[i]); AssetImporter ai = AssetImporter.GetAtPath(childpaths[i]); Object obj = AssetDatabase.LoadAssetAtPath(childpaths[i], typeof(Object)); RemoveUselessLabels(obj); List <string> labels = AssetDatabase.GetLabels(obj).ToList(); foreach (string lb in labels) { if (lb == LABEL_AB) { labels.Remove(lb); AssetDatabase.SetLabels(obj, labels.ToArray()); break; } } Menu.SetChecked(Mark_AssetBundle, false); ai.assetBundleName = null; AssetDatabase.RemoveUnusedAssetBundleNames(); ResetQMark(childpaths[i]); } }
static void MakePackage() { var path = MouseSelector.GetSelectedPathOrFallback(); if (path.IsNotNullAndEmpty()) { if (Directory.Exists(path)) { var installPath = string.Empty; if (path.EndsWith("/")) { installPath = path; } else { installPath = path + "/"; } new PackageVersion { InstallPath = installPath, Version = "v0.0.0" }.Save(); AssetDatabase.Refresh(); } } }
static string MakeInstallPath() { var path = MouseSelector.GetSelectedPathOrFallback(); if (path.EndsWith("/")) { return(path); } return(path + "/"); }
public static void MarkQABForAllSubFolder() { var path = MouseSelector.GetSelectedPathOrFallback(); var childpaths = Directory.GetDirectories(path); foreach (var childpath in childpaths) { Debug.Log(">>>>>> Mark QAB: " + childpath); MarkQABAlways(childpath); } }
public static void MarkQABForAllSubFolder() { string path = MouseSelector.GetSelectedPathOrFallback(); string[] childpaths = Directory.GetDirectories(path); for (int i = 0; i < childpaths.Length; i++) { Debug.Log(">>>>>> Mark QAB: " + childpaths[i]); MarkQABAlways(childpaths[i]); } }
public static void MarkQABForAllSubAssets() { var path = MouseSelector.GetSelectedPathOrFallback(); var childpaths = Directory.GetFiles(path); foreach (var childpath in childpaths) { Debug.Log(">>>>>> Mark QAB: " + childpath); if (!childpath.EndsWith(".meta")) { MarkQABAlways(childpath); } } }
public static void MarkQABForAllSubAssets() { string path = MouseSelector.GetSelectedPathOrFallback(); string[] childpaths = Directory.GetFiles(path); for (int i = 0; i < childpaths.Length; i++) { Debug.Log(">>>>>> Mark QAB: " + childpaths[i]); if (!childpaths [i].EndsWith(".meta")) { MarkQABAlways(childpaths [i]); } } }
private static void OnSelectionChanged() { string path = MouseSelector.GetSelectedPathOrFallback(); if (!string.IsNullOrEmpty(path)) { // Object obj = AssetDatabase.LoadAssetAtPath (path,typeof(Object)); // bool contain = HasQABLabel(obj,LABEL_AB); // Menu.SetChecked (Mark_AssetBundle, contain); // contain = HasQABLabel (obj,LABEL_ZIP); // Menu.SetChecked (Mark_HotUpdateZip,contain); // contain = HasQABLabel (obj,LABEL_FILE); // Menu.SetChecked (Mark_HotUpdateFile,contain); } }
private static void ExportPacakge() { var path = MouseSelector.GetSelectedPathOrFallback(); if (path.IsNotNullAndEmpty()) { if (Directory.Exists(path)) { var packageVersion = PackageVersion.Load(path); var fileName = packageVersion.Name + "_" + packageVersion.Version + ".unitypackage"; ExportPaths(fileName, path); OpenInFileBrowser.Open(EXPORT_ROOT_DIR); } } }
public static void MarkHotUpdateFile() { string path = MouseSelector.GetSelectedPathOrFallback(); if (string.IsNullOrEmpty(path) || !File.Exists(path)) { return; } Object obj = AssetDatabase.LoadAssetAtPath(path, typeof(Object)); bool contain = SetLabels(obj, LABEL_FILE); if (!contain) { Menu.SetChecked(Mark_HotUpdateFile, false); } else { Menu.SetChecked(Mark_HotUpdateFile, true); } ResetQMark(path); }
public static void MarkQABDir() { string path = MouseSelector.GetSelectedPathOrFallback(); MarkQAB(path); }