Exemplo n.º 1
0
        public static void BuildAssetBundles()
        {
            string path = Path.Combine(Path.Combine("../ClientRes", UUtility.GetPlatformName()), "assetbundle");

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            BuildPipeline.BuildAssetBundles(path, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
        }
Exemplo n.º 2
0
        private static void CopyAssetBundlesTo(string outputPath)
        {
            FileUtil.DeleteFileOrDirectory(Application.streamingAssetsPath);
            Directory.CreateDirectory(outputPath);
            string platformName = UUtility.GetPlatformName();
            string path         = Path.Combine(Path.Combine(Environment.CurrentDirectory, "../ClientRes"), platformName);

            if (!Directory.Exists(path))
            {
                Debug.Log("No assetBundle output folder, try to build the assetBundles first.");
            }
            string str2 = Path.Combine(outputPath, platformName);

            if (Directory.Exists(str2))
            {
                FileUtil.DeleteFileOrDirectory(str2);
            }
            FileUtil.CopyFileOrDirectory(path, str2);
        }