Exemple #1
0
    public static void ExportMusic()
    {
        string sourcePath = HS_Path.CombinePath("Assets", "SubAssets", "Raw", "Music");
        string targetPath = HS_Path.CombinePath("Assets", "SubAssets", "Res", "Prefabs", "Music");

        string[] allAssets = AssetDatabase.FindAssets("t:Object", new string[] { sourcePath });
        for (int i = 0; i < allAssets.Length; i++)
        {
            string    assetPath = AssetDatabase.GUIDToAssetPath(allAssets[i]);
            AudioClip prefab    = AssetDatabase.LoadAssetAtPath <AudioClip>(assetPath);
            if (prefab != null)
            {
                string prefabPath = HS_Path.CombinePath(targetPath, HS_Path.GetFileName(assetPath));
                AssetDatabase.CopyAsset(assetPath, prefabPath);
            }
        }

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
        Debug.Log("Done!");
    }
Exemple #2
0
        static private void FilterEditorDLL(FilterEditorDLLModel model)
        {
            string rootPath = S_RootPath;

            rootPath = rootPath.Replace("\\", "/");
            string dll     = rootPath + "/Assets/Plugins/HSEngineEditor.dll";
            string destDll = rootPath + "/" + HS_Path.GetFileName(dll);

            if (model == FilterEditorDLLModel.Backups2Assets)
            {
                string temp = destDll;
                destDll = dll;
                dll     = temp;
            }

            if (HS_File.Exists(dll))
            {
                FileUtil.CopyFileOrDirectory(dll, destDll);
                FileUtil.DeleteFileOrDirectory(dll);
                AssetDatabase.Refresh();
            }
        }