Ejemplo n.º 1
0
        public void SetName()
        {
            bool   success = true;
            string errMsg  = string.Empty;

            if (Directory.Exists(path))
            {
                if (!AssetBundleNamesSetting.SetBundleName(path, name, variant, string.IsNullOrEmpty(ignore) ? null : ignore.Split(','), separated, true, out errMsg))
                {
                    success = false;
                }
            }
            else
            {
                success = false;
                errMsg  = string.Format("Setting Path is not exist: {0}", path);
            }

            AssetDatabase.RemoveUnusedAssetBundleNames();
            AssetDatabase.SaveAssets();
            if (!Application.isBatchMode)
            {
                EditorUtility.ClearProgressBar();
                EditorUtility.DisplayDialog("AssetBundleNamesSetting", success ? "Success" : errMsg, "Close");
            }
        }
Ejemplo n.º 2
0
        public void ClearName()
        {
            bool success = AssetBundleNamesSetting.CleanAssetBundleNames(path, out string errMsg);

            AssetDatabase.RemoveUnusedAssetBundleNames();
            AssetDatabase.SaveAssets();
            if (!Application.isBatchMode)
            {
                EditorUtility.ClearProgressBar();
                EditorUtility.DisplayDialog("AssetBundleNamesSetting", success ? "Done!" : errMsg, "Close");
            }
        }
Ejemplo n.º 3
0
 static public void SetAllAssetBundleNames()
 {
     string[] files = Directory.GetFiles("Assets", "*.asset", SearchOption.AllDirectories);
     foreach (string file in files)
     {
         System.Type t = AssetDatabase.GetMainAssetTypeAtPath(file);
         if (t == typeof(AssetBundleNamesSetting))
         {
             AssetBundleNamesSetting setting = AssetDatabase.LoadAssetAtPath(file, t) as AssetBundleNamesSetting;
             setting.SetBundleNames();
         }
     }
 }