Beispiel #1
0
    static void CopyVideo()
    {
        string source      = Path.Combine(Application.dataPath, AssetBundleConfig.StoryVideoSrcPath);
        string destination = Path.Combine(Application.dataPath, "StreamingAssets");

        destination = Path.Combine(destination, AssetBundleConfig.StoryVideoPath);
        PackageUtils.CopyFolder(source, destination, ".meta");

        source      += "_Low";
        destination += "_Low";
        PackageUtils.CopyFolder(source, destination, ".meta");

        //try
        //{
        //    FileUtil.CopyFileOrDirectoryFollowSymlinks(source, destination);
        //    var allManifest = GameUtility.GetSpecifyFilesInFolder(destination, new string[] { ".meta" });
        //    if (allManifest != null && allManifest.Length > 0)
        //    {
        //        for (int i = 0; i < allManifest.Length; i++)
        //        {
        //            GameUtility.SafeDeleteFile(allManifest[i]);
        //        }
        //    }
        //}
        //catch (System.Exception ex)
        //{
        //    Debug.LogError("Something wrong, you need manual delete folder in StreamingAssets, err : " + ex);
        //    return;
        //}
        Debug.Log("Video Copy Finished");
        AssetDatabase.Refresh();
    }