Пример #1
0
    public static string MarkInFile(string dirPath)
    {
        if (string.IsNullOrEmpty(dirPath))
        {
            return("");
        }

        FileInfo fi = new FileInfo(dirPath);

        string path = dirPath.Substring(fi.DirectoryName.IndexOf("Assets", 0));

        string markingName = fi.Name.Replace(fi.Extension, "");// string.Format(PARTS_MATERIALS_PREFIX, );

        AssetImporter importer = AssetImporter.GetAtPath(path);

        if (importer)
        {
            importer.assetBundleName = markingName + "." + EditorABSetting.GetBundleExtenstion();
        }
        else
        {
            Debug.Log("Reject -> " + path);
        }

        string msg = "Marking Complete File : " + fi.Name;

        return(msg);
    }
Пример #2
0
    void InfoHeaderGUI()
    {
        EditorTools.DrawHeader("Info", true);
        EditorTools.BeginContents(false);

        GUI.contentColor = Color.white;
        GUILayout.Label("\u25BA Absolute Project Path >  " + EditorABSetting.GetProjectPath());
        GUILayout.Label("\u25BA Current Build Setting Platform >  " + EditorUserBuildSettings.activeBuildTarget.ToString());
        GUILayout.Label("\u25BA Selected Bundle Extenstion >  " + EditorABSetting.GetBundleExtenstion());
        GUILayout.Label("\u25BA BundleExport FullPath >  " + EditorABSetting.GetBuildExportFullPath());
        GUI.contentColor = Color.white;

        EditorTools.EndContents();
    }
Пример #3
0
    public static string MarkFolderInFiles(string dirPath)
    {
        if (string.IsNullOrEmpty(dirPath))
        {
            return("");
        }

        string msg = string.Empty;
        List <STAssetFiles> tableFiles = GetAssetDirInFiles(dirPath, SearchOption.AllDirectories);
        AssetImporter       importer;

        string folder      = string.Empty;
        int    totalAmount = tableFiles.Count;

        if (totalAmount > 0)
        {
            folder = tableFiles[0].folder;
            IEnumerator progressShow = OnProgress(folder, tableFiles, 0, totalAmount - 1);
            for (int i = 0; i < totalAmount; i++)
            {
                importer = AssetImporter.GetAtPath(tableFiles[i].path + "/" + tableFiles[i].name);
                if (importer)
                {
                    importer.assetBundleName = folder + "." + EditorABSetting.GetBundleExtenstion();
                }
                else
                {
                    Debug.Log("Reject -> " + tableFiles[i].path);
                }
                progressShow.MoveNext();
            }
            msg = "Marking Complete Folder : " + folder;
        }

        return(msg);
    }