コード例 #1
0
    static void CopyAssetBundlesTo(string outputPath)
    {
        // Clear streaming assets folder.
        FileUtil.DeleteFileOrDirectory(Application.streamingAssetsPath);
        Directory.CreateDirectory(outputPath);

        string outputFolder = AssetBundlePlatformPathManager.GetPlatformFolderForAssetBundles(EditorUserBuildSettings.activeBuildTarget);

        // Setup the source folder for assetbundles.
        var source = AssetBundlePlatformPathManager.GetAssetBundleStorePath();

        if (!System.IO.Directory.Exists(source))
        {
            Debug.Log("No assetBundle output folder, try to build the assetBundles first.");
        }

        // Setup the destination folder for assetbundles.
        var destination = outputPath + outputFolder;

        if (System.IO.Directory.Exists(destination))
        {
            FileUtil.DeleteFileOrDirectory(destination);
        }

        FileUtil.CopyFileOrDirectory(source, destination);
    }
コード例 #2
0
    public static void BuildAssetBundles()
    {
        string fullpath = AssetBundlePlatformPathManager.GetAssetBundleStorePath();

        if (!Directory.Exists(fullpath))
        {
            Directory.CreateDirectory(fullpath);
        }

        BuildPipeline.BuildAssetBundles(fullpath, 0, EditorUserBuildSettings.activeBuildTarget);
    }