/// <summary>
        /// アセットバンドルファイル存在確認
        /// </summary>
        /// <param name="platform">プラットフォーム</param>
        /// <param name="assetBundleNameWithVariant">バリアント付きアセットバンドル名</param>
        /// <returns>true:存在する, false:無い</returns>
        private bool ExistsAssetBundleFile(string platform, string assetBundleNameWithVariant)
        {
            var fileName = m_HashAlgorithm.GetAssetBundleFileName(platform, assetBundleNameWithVariant);
            var filePath = AssetBundleBuilder.kOutputPath + "/" + fileName;
            var result   = AssetBundleEditorUtility.Exists(filePath);

            return(result);
        }
Exemple #2
0
        private static void Postprocessor(AssetBundlePostprocessorArg arg)
        {
            //Missingファイルをダウンロードエラーにする為に削除する
            var missingAssetBundlePath = arg.GetAssetBundlePath("AssetBundleShoshaDemo/Missing");

            if (AssetBundleEditorUtility.Exists(missingAssetBundlePath))
            {
                FileUtil.DeleteFileOrDirectory(missingAssetBundlePath);
            }
        }
        /// <summary>
        /// バックアップディレクトリパスの取得
        /// </summary>
        /// <returns>バックアップディレクトリパス</returns>
        private static string GetBackupDirectoryPath()
        {
            var index = 0;

            while (AssetBundleEditorUtility.Exists(kBackupBasePath + "/" + index.ToString()))
            {
                ++index;
            }
            var result = kBackupBasePath + "/" + index.ToString();

            return(result);
        }
Exemple #4
0
        public static void BuildAssetBundlesForCurrentPlatform()
        {
            var targetPlatform = AssetBundleEditorUtility.GetCurrentBuildTarget();

            if (targetPlatform != BuildTarget.NoTarget)
            {
                var options = AssetBundleEditorUtility.GetBuildOptions();
                AssetBundleBuilder.Build(targetPlatform, options);
            }
            else
            {
                Debug.LogError("Current platform has not supported.");
            }
        }
        public void OutputFiles()
        {
            Assert.IsTrue(AssetBundleEditorUtility.Exists(AssetBundleBuilder.kOutputPath));

            var platformString = AssetBundleUtility.GetPlatformString();

            Assert.IsTrue(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/primitive"));
            Assert.IsTrue(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/colormaterialscommon"));
            Assert.IsTrue(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/colormaterials.red"));
            Assert.IsTrue(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/colormaterials.green"));
            Assert.IsTrue(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/colormaterials.blue"));
            Assert.IsTrue(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/excludematerials"));
            Assert.IsFalse(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/excludeassetbundle"));
            Assert.IsTrue(ExistsAssetBundleFile(platformString, "assetbundleshoshatest/cryptoassetbundle"));
            Assert.IsTrue(ExistsAssetBundleFile(null, "deliverystreamingassets:assetbundleshoshatest/binary"));
            Assert.IsTrue(ExistsAssetBundleFile(null, "deliverystreamingassets:assetbundleshoshatest/deliverystreamingassets"));
            Assert.IsTrue(ExistsAssetBundleFile(null, "deliverystreamingassets:assetbundleshoshatest/variantstream.variant1"));
            Assert.IsTrue(ExistsAssetBundleFile(null, "deliverystreamingassets:assetbundleshoshatest/variantstream.variant2"));
            Assert.IsTrue(ExistsAssetBundleFile(null, "deliverystreamingassets:assetbundleshoshatest/zerobytedeliverystreamingassets"));
            Assert.IsFalse(ExistsAssetBundleFile(null, "deliverystreamingassets:assetbundleshoshatest/excludedeliverystreamingassets"));
        }
 /// <summary>
 /// 作業ディレクトリのバックアップ
 /// </summary>
 private void BackupWorkDirectory()
 {
     if (!AssetBundleEditorUtility.Exists(kBackupBasePath))
     {
         Directory.CreateDirectory(Application.dataPath + "/../" + kBackupBasePath);
     }
     if (AssetBundleEditorUtility.Exists(AssetBundleBuilder.kOutputPath))
     {
         m_BackupOutputPath = GetBackupDirectoryPath();
         FileUtil.MoveFileOrDirectory(AssetBundleBuilder.kOutputPath, m_BackupOutputPath);
     }
     else
     {
         m_BackupOutputPath = null;
     }
     if (AssetBundleEditorUtility.Exists(kBuilderWorkPath))
     {
         m_BackupWorkPath = GetBackupDirectoryPath();
         FileUtil.MoveFileOrDirectory(kBuilderWorkPath, m_BackupWorkPath);
     }
     else
     {
         m_BackupWorkPath = null;
     }
     if (AssetBundleEditorUtility.Exists(kBuilderInAssetsWorkPath))
     {
         m_BackupInAssetsWorkPath = GetBackupDirectoryPath();
         FileUtil.MoveFileOrDirectory(kBuilderInAssetsWorkPath, m_BackupInAssetsWorkPath);
         if (AssetBundleEditorUtility.Exists(kBuilderInAssetsWorkPath + ".meta"))
         {
             FileUtil.MoveFileOrDirectory(kBuilderInAssetsWorkPath + ".meta", m_BackupInAssetsWorkPath + ".meta");
         }
     }
     else
     {
         m_BackupWorkPath = null;
     }
 }
Exemple #7
0
 public AssetInfoBase(string fullPath, string name)
 {
     FullPath  = fullPath;
     AssetPath = AssetBundleEditorUtility.GetAssetPathByFullPath(fullPath);
     Name      = name;
 }
Exemple #8
0
        public static void BuildAssetBundlesForWebGL()
        {
            var options = AssetBundleEditorUtility.GetBuildOptions();

            AssetBundleBuilder.Build(BuildTarget.WebGL, options);
        }
Exemple #9
0
        public static void BuildAssetBundlesForWindows()
        {
            var options = AssetBundleEditorUtility.GetBuildOptions();

            AssetBundleBuilder.Build(BuildTarget.StandaloneWindows64, options);
        }