Exemplo n.º 1
0
        // step 3
        // Trim about starting with : "Assets/Res/test.png" or "Assets/Res/test/"
        // return "assets.res.test.png.a" or "assets.res.test.a"
        private string TrimAssetBundleName(string assetName, BuildTarget buildTarget)
        {
            assetName = assetName.Replace("\\", "/").Replace("/", ".").Replace(" ", "");
            string adExStr = Utility.Platform.GetPlatformAssetBundleEx(buildTarget.TranslateToBuildTarget());

            return(Utility.Text.Format("{0}.{1}", assetName, adExStr).ToLower());
        }
Exemplo n.º 2
0
        // step 1
        private string CheckBuildDir(BuildTarget buildTarget)
        {
            EditorUtility.DisplayProgressBar("Check Build Directory", string.Empty, 0);

            //check build root folder
            if (!Directory.Exists(PathConst.AssetBundleBuildRoot))
            {
                Directory.CreateDirectory(PathConst.AssetBundleBuildRoot);
            }

            // check platform folder
            string platformPath = Utility.Text.Format("{0}{1}/", PathConst.AssetBundleBuildRoot, Utility.Platform.GetRuntimePlatformIndexName(buildTarget.TranslateToBuildTarget()));

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

            // check version folder
            string versionPath = Utility.Text.Format("{0}{1}.{2}.{3}/", platformPath, _buildAbConfig.version1, _buildAbConfig.version2, _buildAbConfig.version3);

            if (Directory.Exists(versionPath))
            {
                Directory.Delete(versionPath, true);
            }
            Directory.CreateDirectory(versionPath);

            EditorUtility.DisplayProgressBar("Check Build Directory", string.Empty, 0);

            return(versionPath);
        }