Exemplo n.º 1
0
        protected void OnComplete(Texture2D texture, double totalMilliseconds)
        {
            if (Debug.isDebugBuild)
            {
                var builder = new StringBuilder();

                builder.AppendFormat("URL: {0} ({1}ms)", currentRequest.url, totalMilliseconds).AppendLine();
                builder.AppendLine();

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
            }

            if (onComplete != null)
            {
                onComplete.OnNext(texture);
            }
        }
Exemplo n.º 2
0
        private IObservable <Unit> PreLoadScene(Scenes[] targetScenes)
        {
            if (targetScenes.IsEmpty())
            {
                return(Observable.ReturnUnit());
            }

            var builder = new StringBuilder();

            var observers = new List <IObservable <Unit> >();

            foreach (var scene in targetScenes)
            {
                // キャッシュ済みのシーンがある場合はプリロードしない.
                if (cacheScenes.Any(x => x.Identifier == scene))
                {
                    continue;
                }

                var observer = Observable.Defer(() => Observable.FromMicroCoroutine(() => PreLoadCore(scene, builder)));

                observers.Add(observer);
            }

            if (observers.IsEmpty())
            {
                return(Observable.ReturnUnit());
            }

            var sw = System.Diagnostics.Stopwatch.StartNew();

            return(observers.WhenAll()
                   .Do(_ =>
            {
                sw.Stop();

                var time = sw.Elapsed.TotalMilliseconds;
                var detail = builder.ToString();

                var message = string.Format("PreLoad Complete ({0:F2}ms)\n\n{1}", time, detail);

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, message);
            })
                   .AsUnitObservable());
        }
Exemplo n.º 3
0
        private void ReleaseSoundSheet()
        {
            for (var i = 0; i < soundElements.Count; ++i)
            {
                if (!soundElements[i].FinishTime.HasValue)
                {
                    continue;
                }

                // 終了確認した時間から一定時間経過していたら解放.
                if (soundElements[i].FinishTime.Value + releaseTime < Time.realtimeSinceStartup)
                {
                    soundElements.RemoveAt(i);
                }
            }

            var targets = new List <SoundSheet>();

            foreach (var item in managedSoundSheets)
            {
                var release = true;

                // 再生中のCueが存在したら生存.
                foreach (var soundElement in soundElements)
                {
                    if (item.Key == soundElement.SoundSheet.AssetPath)
                    {
                        release = false;
                        break;
                    }
                }

                if (release)
                {
                    targets.Add(item.Value);
                }
            }

            foreach (var target in targets)
            {
                CriAtom.RemoveCueSheet(target.AssetPath);
                managedSoundSheets.Remove(target.AssetPath);
                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "UnLoad : {0}", SoundSheet.AcbPath(target.AssetPath));
            }
        }
Exemplo n.º 4
0
        private IEnumerator GetCueInfoInternal(IObserver <CueInfo> observer, string resourcePath, string cue)
        {
            if (string.IsNullOrEmpty(resourcePath))
            {
                observer.OnError(new ArgumentException("resourcePath"));
            }
            else
            {
                var filePath = ConvertCriFilePath(resourcePath);

                if (!CheckAssetVersion(resourcePath, filePath) && !localMode)
                {
                    var assetInfo = GetAssetInfo(resourcePath);
                    var assetPath = PathUtility.Combine(resourceDir, resourcePath);

                    var sw = System.Diagnostics.Stopwatch.StartNew();

                    var updateYield = UpdateAsset(resourcePath).ToYieldInstruction(false, yieldCancel.Token);

                    while (!updateYield.IsDone)
                    {
                        yield return(null);
                    }

                    sw.Stop();

                    var builder = new StringBuilder();

                    builder.AppendFormat("Update: {0} ({1:F2}ms)", Path.GetFileName(filePath), sw.Elapsed.TotalMilliseconds).AppendLine();
                    builder.AppendLine();
                    builder.AppendFormat("LoadPath = {0}", assetPath).AppendLine();
                    builder.AppendFormat("FileName = {0}", assetInfo.FileName).AppendLine();
                    builder.AppendFormat("Hash = {0}", assetInfo.FileHash).AppendLine();

                    UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
                }

                filePath = PathUtility.GetPathWithoutExtension(filePath) + CriAssetDefinition.AcbExtension;

                observer.OnNext(File.Exists(filePath) ? new CueInfo(cue, filePath) : null);
            }

            observer.OnCompleted();
        }
Exemplo n.º 5
0
        private IEnumerator UpdateManifestInternal(IProgress <float> progress = null)
        {
            var sw = System.Diagnostics.Stopwatch.StartNew();

            // アセット管理情報読み込み.

            var manifestFileName = AssetInfoManifest.ManifestFileName;

            #if UNITY_EDITOR
            if (simulateMode)
            {
                manifestFileName = PathUtility.Combine(resourceDir, manifestFileName);
            }
            #endif

            var manifestAssetInfo = AssetInfoManifest.GetManifestAssetInfo();

            // AssetInfoManifestは常に最新に保たなくてはいけない為必ずダウンロードする.
            var loadYield = assetBundleManager.UpdateAssetInfoManifest()
                            .SelectMany(_ => assetBundleManager.LoadAsset <AssetInfoManifest>(manifestAssetInfo, manifestFileName))
                            .ToYieldInstruction(false);

            yield return(loadYield);

            if (loadYield.HasError || loadYield.IsCanceled)
            {
                yield break;
            }

            SetAssetInfoManifest(loadYield.Result);

            sw.Stop();

            var message = string.Format("UpdateManifest: ({0}ms)", sw.Elapsed.TotalMilliseconds);
            UnityConsole.Event(ConsoleEventName, ConsoleEventColor, message);

            // アセット管理情報を登録.

            assetBundleManager.SetManifest(assetInfoManifest);

            #if ENABLE_CRIWARE_ADX || ENABLE_CRIWARE_SOFDEC
            criAssetManager.SetManifest(assetInfoManifest);
            #endif
        }
Exemplo n.º 6
0
        private SoundSheet GetSoundSheet(CueInfo cueInfo)
        {
            if (cueInfo == null)
            {
                return(null);
            }

            var assetPath  = cueInfo.CueSheetPath;
            var soundSheet = managedSoundSheets.GetValueOrDefault(assetPath);

            if (soundSheet == null)
            {
                // パス情報生成.
                var acbPath = SoundSheet.AcbPath(assetPath);
                var awbPath = SoundSheet.AwbPath(assetPath);

                // ACBファイルのロード.
                CriAtomCueSheet cueSheet = null;

                try
                {
                    cueSheet = CriAtom.AddCueSheet(assetPath, acbPath, awbPath);
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                    return(null);
                }

                if (cueSheet.acb == null)
                {
                    return(null);
                }

                // ロードしたACBを保持した状態で再生成.
                soundSheet = new SoundSheet(assetPath, cueSheet.acb);

                managedSoundSheets.Add(soundSheet.AssetPath, soundSheet);

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "Load : {0}", acbPath);
            }

            return(soundSheet);
        }
Exemplo n.º 7
0
        /// <summary> 成功時イベント. </summary>
        protected override void OnComplete <TResult>(TWebRequest webRequest, TResult result, double totalMilliseconds)
        {
            if (LogEnable)
            {
                var json = string.Empty;

                switch (Format)
                {
                case DataFormat.Json:
                {
                    json = result.ToJson();
                }
                break;

                case DataFormat.MessagePack:
                {
                    var options = StandardResolverAllowPrivate.Options.WithResolver(UnityContractResolver.Instance);

                    if (Compress)
                    {
                        options = options.WithCompression(MessagePackCompression.Lz4Block);
                    }

                    json = MessagePackSerializer.SerializeToJson(result, options);
                }
                break;
                }

                var builder = new StringBuilder();

                builder.AppendFormat("{0} ({1:F1}ms)", webRequest.HostUrl.Replace(HostUrl, string.Empty), totalMilliseconds).AppendLine();
                builder.AppendLine();
                builder.AppendFormat("URL: {0}", webRequest.Url).AppendLine();
                builder.AppendFormat("Result: {0}", json).AppendLine();
                builder.AppendLine();

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());

                #if UNITY_EDITOR
                ApiTracker.Instance.OnComplete(webRequest, json, totalMilliseconds);
                #endif
            }
        }
Exemplo n.º 8
0
        private void OnTimeout(Exception ex)
        {
            var type = ex.GetType();

            if (type == typeof(TimeoutException))
            {
                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "WebRequest Retry\n{0}\n", currentRequest.url);
            }
            else
            {
                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "WebRequest TimeoutError\n{0}\n{1}\n", currentRequest.url, ex.Message);

                Cancel();

                if (onTimeout != null)
                {
                    onError.OnNext(Unit.Default);
                }
            }
        }
Exemplo n.º 9
0
        //----- params -----

        //----- field -----

        //----- property -----

        //----- method -----

        public static void Execute()
        {
            var editorConfig = ProjectFolders.Instance;
            var soundConfig  = SoundConfig.Instance;
            var movieConfig  = MovieConfig.Instance;

            var scriptPath            = editorConfig.ScriptPath;
            var streamingAssetPath    = editorConfig.StreamingAssetPath;
            var externalResourcesPath = editorConfig.ExternalResourcesPath;

            var streamingAssetFolderName    = Path.GetFileName(streamingAssetPath);
            var externalResourcesFolderName = Path.GetFileName(externalResourcesPath);

            // Sound.
            UpdateSoundAssets(soundConfig, scriptPath, streamingAssetFolderName, externalResourcesFolderName);

            // Movie.
            UpdateMovieAssets(movieConfig, scriptPath, streamingAssetFolderName, externalResourcesFolderName);

            UnityConsole.Event(CriWareConsoleEvent.Name, CriWareConsoleEvent.Color, "UpdateCriAssets Complete.");
        }
Exemplo n.º 10
0
        private IEnumerator UpdateCacheInternal(IObserver <bool> observer, string applicationVersion, string masterVersion, AesManaged aesManaged, CancellationToken cancelToken)
        {
            var result = true;

            var localVersion = versionPrefs.version;

            var sw = System.Diagnostics.Stopwatch.StartNew();

            var updateYield = UpdateMaster().ToYieldInstruction(false, cancelToken);

            while (!updateYield.IsDone)
            {
                yield return(null);
            }

            if (updateYield.HasResult && !updateYield.HasError)
            {
                result &= SaveCache(updateYield.Result, applicationVersion, masterVersion, aesManaged);

                sw.Stop();

                if (result)
                {
                    var version = ConvertVersionStr(applicationVersion, masterVersion);

                    var message = string.Format("[{0}] Version : {1} >>> {2}", typeof(TInstance).Name, string.IsNullOrEmpty(localVersion) ? "---" : localVersion, version);

                    UnityConsole.Event(ConsoleEventName, ConsoleEventColor, message);

                    MasterCacheUpdateDiagnostic.Instance.Register <TInstance>(sw.Elapsed.TotalMilliseconds);
                }
            }
            else
            {
                result = false;
            }

            observer.OnNext(result);
            observer.OnCompleted();
        }
Exemplo n.º 11
0
        public static void Build(string externalResourcesPath)
        {
            var exportPath = GetExportPath();

            if (string.IsNullOrEmpty(exportPath))
            {
                return;
            }

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

            EditorApplication.LockReloadAssemblies();

            #if ENABLE_CRIWARE
            CriAssetGenerator.Generate(exportPath, externalResourcesPath);
            #endif

            // CriAssetGeneratorでCriのManifestファイルを生成後に実行.
            var assetBundleManifest = BuildAssetBundle.BuildAllAssetBundles(exportPath);

            // ビルド成果物の情報をAssetInfoManifestに書き込み.
            AssetInfoManifestGenerator.SetAssetFileInfo(exportPath, externalResourcesPath, assetBundleManifest);

            // 再度AssetInfoManifestだけビルドを実行.
            BuildAssetBundle.BuildAssetInfoManifest(exportPath, externalResourcesPath);

            // 不要ファイル削除.
            BuildAssetBundle.DeleteUnUseFiles(exportPath);

            // AssetBundleファイルをパッケージ化.
            BuildAssetBundle.BuildPackage(exportPath);

            EditorApplication.UnlockReloadAssemblies();

            UnityConsole.Event(ExternalResources.ConsoleEventName, ExternalResources.ConsoleEventColor, "Build ExternalResource Complete.");
        }
Exemplo n.º 12
0
        //----- params -----

        //----- field -----

        //----- property -----

        //----- method -----

        public static void Execute()
        {
            var editorConfig = ProjectFolders.Instance;

            var scriptPath            = editorConfig.ScriptPath;
            var streamingAssetPath    = editorConfig.StreamingAssetPath;
            var externalResourcesPath = editorConfig.ExternalResourcesPath;

            var streamingAssetFolderName    = Path.GetFileName(streamingAssetPath);
            var externalResourcesFolderName = Path.GetFileName(externalResourcesPath);

            var criAssetConfig = CriAssetConfig.Instance;

            #if ENABLE_CRIWARE_ADX
            UpdateSoundAssets(criAssetConfig, scriptPath, streamingAssetFolderName, externalResourcesFolderName);
            #endif

            #if ENABLE_CRIWARE_SOFDEC
            UpdateMovieAssets(criAssetConfig, scriptPath, streamingAssetFolderName, externalResourcesFolderName);
            #endif

            UnityConsole.Event(CriWareConsoleEvent.Name, CriWareConsoleEvent.Color, "UpdateCriAssets Complete.");
        }
Exemplo n.º 13
0
        private IEnumerator AppendCore(IObserver <SceneInstance> observer, Scenes?identifier, bool activeOnLoad)
        {
            if (!identifier.HasValue)
            {
                yield break;
            }

            SceneInstance sceneInstance = null;

            var diagnostics = new TimeDiagnostics();

            diagnostics.Begin(TimeDiagnostics.Measure.Append);

            var loadYield = LoadScene(identifier.Value, LoadSceneMode.Additive).ToYieldInstruction();

            yield return(loadYield);

            if (loadYield.HasResult)
            {
                sceneInstance = loadYield.Result;

                diagnostics.Finish(TimeDiagnostics.Measure.Append);

                var additiveTime = diagnostics.GetTime(TimeDiagnostics.Measure.Append);

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "{0} ({1}ms)(Additive)", identifier.Value, additiveTime);
            }

            if (activeOnLoad)
            {
                sceneInstance.Enable();
            }

            observer.OnNext(sceneInstance);
            observer.OnCompleted();
        }
Exemplo n.º 14
0
        public static async Task <string> Build(string exportPath, AssetInfoManifest assetInfoManifest, bool openExportFolder = true)
        {
            if (string.IsNullOrEmpty(exportPath))
            {
                return(null);
            }

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

            var versionHash = string.Empty;

            var assetManagement = AssetManagement.Instance;

            assetManagement.Initialize();

            var buildAssetBundle = new BuildAssetBundle(BundlePipeline);

            EditorApplication.LockReloadAssemblies();

            try
            {
                var stopwatch = System.Diagnostics.Stopwatch.StartNew();

                var logBuilder = new StringBuilder();

                var manageConfig = ManageConfig.Instance;

                var cryptoKey = manageConfig.CryptoKey;
                var cryptoIv  = manageConfig.CryptoIv;

                var assetBundlePath = buildAssetBundle.GetAssetBundleOutputPath();

                // 暗号化鍵情報の変更チェック.

                var cryptoChanged = BuildAssetBundlePackage.CheckCryptoFile(assetBundlePath, cryptoKey, cryptoIv);

                using (new DisableStackTraceScope())
                {
                    var processTime = System.Diagnostics.Stopwatch.StartNew();

                    //------ アセットバンドル名を設定------

                    using (new BuildLogScope(logBuilder, processTime, "ApplyAllAssetBundleName"))
                    {
                        assetManagement.ApplyAllAssetBundleName();
                    }

                    //------ キャッシュ済みアセットバンドルの最終更新日時取得 ------

                    Dictionary <string, DateTime> cachedFileLastWriteTimeTable = null;

                    using (new BuildLogScope(logBuilder, processTime, "GetCachedFileLastWriteTimeTable"))
                    {
                        cachedFileLastWriteTimeTable = await buildAssetBundle.GetCachedFileLastWriteTimeTable();
                    }

                    //------ CRIアセットを生成 ------

                    #if ENABLE_CRIWARE_ADX || ENABLE_CRIWARE_SOFDEC
                    using (new BuildLogScope(logBuilder, processTime, "GenerateCriAsset"))
                    {
                        CriAssetGenerator.Generate(exportPath, assetInfoManifest);
                    }
                    #endif

                    //------ AssetBundleをビルド ------

                    BuildResult buildResult = null;

                    using (new BuildLogScope(logBuilder, processTime, "BuildAllAssetBundles"))
                    {
                        buildResult = buildAssetBundle.BuildAllAssetBundles();
                    }

                    if (!buildResult.IsSuccess)
                    {
                        Debug.LogError("Build ExternalResource failed.");

                        return(null);
                    }

                    //------ 未登録のアセットバンドル情報追加 ------

                    using (new BuildLogScope(logBuilder, processTime, "AddUnregisteredAssetInfos"))
                    {
                        buildAssetBundle.AddUnregisteredAssetInfos(assetInfoManifest, buildResult);
                    }

                    //------ 不要になった古いAssetBundle削除 ------

                    using (new BuildLogScope(logBuilder, processTime, "CleanUnUseAssetBundleFiles"))
                    {
                        buildAssetBundle.CleanUnUseAssetBundleFiles(buildResult);
                    }

                    //------ AssetBundleファイルをパッケージ化 ------

                    // 暗号化鍵情報の書き込み.

                    using (new BuildLogScope(logBuilder, processTime, "CreateCryptoFile"))
                    {
                        BuildAssetBundlePackage.CreateCryptoFile(assetBundlePath, cryptoKey, cryptoIv);
                    }

                    // 更新対象のアセット情報取得.

                    var assetInfos        = new AssetInfo[0];
                    var updatedAssetInfos = new AssetInfo[0];

                    using (new BuildLogScope(logBuilder, processTime, "GetUpdateTargetAssetInfo"))
                    {
                        assetInfos = buildAssetBundle.GetAllTargetAssetInfo(assetInfoManifest);

                        // 暗号化キーが変わっていたら全て更新対象.
                        if (cryptoChanged)
                        {
                            updatedAssetInfos = assetInfos;
                        }
                        // 差分がある対象だけ抽出.
                        else
                        {
                            updatedAssetInfos = await buildAssetBundle.GetUpdateTargetAssetInfo(assetInfoManifest, cachedFileLastWriteTimeTable);
                        }
                    }

                    // パッケージファイル作成.

                    using (new BuildLogScope(logBuilder, processTime, "BuildPackage"))
                    {
                        await BuildAssetBundlePackage.BuildAllAssetBundlePackage(exportPath, assetBundlePath, assetInfos, updatedAssetInfos, cryptoKey, cryptoIv);
                    }

                    //------ ビルド成果物の情報をAssetInfoManifestに書き込み ------

                    using (new BuildLogScope(logBuilder, processTime, "AssetInfoManifest : SetAssetBundleFileInfo"))
                    {
                        await AssetInfoManifestGenerator.SetAssetBundleFileInfo(assetBundlePath, assetInfoManifest, buildResult);

                        #if ENABLE_CRIWARE_ADX || ENABLE_CRIWARE_SOFDEC
                        await AssetInfoManifestGenerator.SetCriAssetFileInfo(exportPath, assetInfoManifest);
                        #endif
                    }

                    //------ アセットバンドルの参照情報をAssetInfoManifestに書き込み ------

                    using (new BuildLogScope(logBuilder, processTime, "AssetInfoManifest : SetAssetBundleDependencies"))
                    {
                        buildAssetBundle.SetDependencies(assetInfoManifest, buildResult);
                    }

                    //------ バージョンハッシュ情報をAssetInfoManifestに書き込み ------

                    using (new BuildLogScope(logBuilder, processTime, "AssetInfoManifest : SetAssetInfoHash"))
                    {
                        buildAssetBundle.SetAssetInfoHash(assetInfoManifest);
                    }

                    //------ 再度AssetInfoManifestだけビルドを実行 ------

                    using (new BuildLogScope(logBuilder, processTime, "Rebuild AssetInfoManifest"))
                    {
                        buildAssetBundle.BuildAssetInfoManifest();
                    }

                    //------ AssetInfoManifestファイルをパッケージ化 ------

                    using (new BuildLogScope(logBuilder, processTime, "BuildPackage AssetInfoManifest"))
                    {
                        await BuildAssetBundlePackage.BuildAssetInfoManifestPackage(exportPath, assetBundlePath, cryptoKey, cryptoIv);
                    }
                }

                versionHash = assetInfoManifest.VersionHash;

                //------ バージョンをファイル出力------

                GenerateVersionFile(exportPath, versionHash);

                //------ ログ出力------

                stopwatch.Stop();

                // ビルド情報.

                var buildLogText = new StringBuilder();

                var totalSeconds = stopwatch.Elapsed.TotalSeconds;

                buildLogText.AppendFormat("Build ExternalResource Complete. ({0:F2}sec)", totalSeconds).AppendLine();
                buildLogText.AppendLine();
                buildLogText.AppendFormat("VersionHash : {0}", versionHash).AppendLine();
                buildLogText.AppendLine();
                buildLogText.AppendLine(logBuilder.ToString());
                buildLogText.AppendLine();

                UnityConsole.Event(ExternalResources.ConsoleEventName, ExternalResources.ConsoleEventColor, buildLogText.ToString());

                //------ 出力先フォルダを開く------

                if (openExportFolder)
                {
                    UnityEditorUtility.OpenFolder(exportPath);
                }
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                throw;
            }
            finally
            {
                EditorApplication.UnlockReloadAssemblies();
            }

            return(versionHash);
        }
Exemplo n.º 15
0
        private IEnumerator LoadMasterInternal(IObserver <bool> observer, Dictionary <IMaster, string> versionTable, IProgress <float> progress)
        {
            #if UNITY_EDITOR
            if (!Prefs.checkVersion)
            {
                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "Use CachedMasterFile.");
            }
            #endif

            var result = true;

            var updateLog = new StringBuilder();
            var loadLog   = new StringBuilder();

            var stopwatch = System.Diagnostics.Stopwatch.StartNew();

            if (versionTable != null)
            {
                if (progress != null)
                {
                    progress.Report(0f);
                }

                var yieldCancel       = new YieldCancel();
                var cancellationToken = yieldCancel.Token;

                var amount         = 1f / versionTable.Count;
                var progressAmount = 0f;

                // 並行で処理.
                var observers = new List <IObservable <Unit> >();

                foreach (var element in versionTable)
                {
                    var master        = element.Key;
                    var masterVersion = element.Value;

                    var masterType = master.GetType();
                    var masterName = masterType.Name;

                    var masterFileName = masterFileNames.GetValueOrDefault(masterType);

                    var localVersion = master.LoadVersion();

                    IObservable <Unit> observable = null;

                    Action <bool, double> onUpdateFinish = (state, time) =>
                    {
                        if (state)
                        {
                            var localVersionText = string.IsNullOrEmpty(localVersion) ? "---" : localVersion;
                            var message          = string.Format("{0} ({1:F1}ms) : {2} >> {3}", masterName, time, localVersionText, masterVersion);

                            updateLog.AppendLine(message);
                        }
                        else
                        {
                            Debug.LogErrorFormat("Update master failed.\nClass : {0}\nFile : {1}\n", masterType.FullName, masterFileName);
                        }

                        result         &= state;
                        progressAmount += amount;

                        if (progress != null)
                        {
                            progress.Report(progressAmount);
                        }

                        if (onUpdateMaster != null)
                        {
                            onUpdateMaster.OnNext(Unit.Default);
                        }
                    };

                    Action <bool, double> onLoadFinish = (state, time) =>
                    {
                        if (state)
                        {
                            loadLog.AppendFormat("{0} ({1:F1}ms)", masterName, time).AppendLine();
                        }
                        else
                        {
                            Debug.LogErrorFormat("Load master failed.\nClass : {0}\nFile : {1}\n", masterType.FullName, masterFileName);
                        }

                        result         &= state;
                        progressAmount += amount;

                        if (progress != null)
                        {
                            progress.Report(progressAmount);
                        }
                    };

                    if (master.CheckVersion(masterVersion))
                    {
                        // 読み込み.
                        observable = Observable.Defer(() =>
                        {
                            return(MasterLoad(master, onLoadFinish).AsUnitObservable());
                        });

                        observers.Add(observable);
                    }
                    else
                    {
                        // ダウンロード + 読み込み.
                        observable = Observable.Defer(() =>
                        {
                            return(MasterUpdate(master, masterVersion, onUpdateFinish, cancellationToken)
                                   .SelectMany(x => x ? MasterLoad(master, onLoadFinish) : Observable.Return(false))
                                   .AsUnitObservable());
                        });

                        observers.Add(observable);
                    }
                }

                // 実行.
                var loadYield = observers.WhenAll().ToYieldInstruction(false, cancellationToken);

                yield return(loadYield);

                if (loadYield.HasError)
                {
                    Debug.LogException(loadYield.Error);
                    result = false;
                }

                if (progress != null)
                {
                    progress.Report(1f);
                }

                yieldCancel.Dispose();
            }

            stopwatch.Stop();

            if (result)
            {
                var logBuilder = new StringBuilder();

                logBuilder.AppendLine(string.Format("Master : ({0:F1}ms)", stopwatch.Elapsed.TotalMilliseconds));
                logBuilder.AppendLine();

                if (0 < updateLog.Length)
                {
                    logBuilder.AppendLine("---------- Download ----------");
                    logBuilder.AppendLine();
                    logBuilder.AppendLine(updateLog.ToString());
                }

                if (0 < loadLog.Length)
                {
                    logBuilder.AppendLine("------------ Load ------------");
                    logBuilder.AppendLine();
                    logBuilder.AppendLine(loadLog.ToString());
                }

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, logBuilder.ToString());

                if (onLoadFinish != null)
                {
                    onLoadFinish.OnNext(Unit.Default);
                }
            }
            else
            {
                if (onError != null)
                {
                    onError.OnNext(Unit.Default);
                }
            }

            observer.OnNext(result);
            observer.OnCompleted();
        }
Exemplo n.º 16
0
        private IEnumerator GetMovieInfoInternal(IObserver <ManaInfo> observer, string resourcePath)
        {
            if (string.IsNullOrEmpty(resourcePath))
            {
                observer.OnError(new ArgumentException("resourcePath"));
            }
            else
            {
                var filePath = ConvertCriFilePath(resourcePath);

                if (!LocalMode && !simulateMode)
                {
                    if (!CheckAssetVersion(resourcePath, filePath))
                    {
                        var assetPath = PathUtility.Combine(resourceDirectory, resourcePath);

                        var sw = System.Diagnostics.Stopwatch.StartNew();

                        var updateYield = UpdateAsset(resourcePath).ToYieldInstruction(false, yieldCancel.Token);

                        while (!updateYield.IsDone)
                        {
                            yield return(null);
                        }

                        sw.Stop();

                        if (LogEnable && UnityConsole.Enable)
                        {
                            var assetInfo = GetAssetInfo(resourcePath);

                            if (assetInfo != null)
                            {
                                var builder = new StringBuilder();

                                builder.AppendFormat("Update: {0} ({1:F2}ms)", Path.GetFileName(filePath), sw.Elapsed.TotalMilliseconds).AppendLine();
                                builder.AppendLine();
                                builder.AppendFormat("LoadPath = {0}", assetPath).AppendLine();
                                builder.AppendFormat("FileName = {0}", assetInfo.FileName).AppendLine();

                                if (!string.IsNullOrEmpty(assetInfo.Hash))
                                {
                                    builder.AppendFormat("Hash = {0}", assetInfo.Hash).AppendLine();
                                }

                                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
                            }
                        }
                    }
                }

                filePath = PathUtility.GetPathWithoutExtension(filePath) + CriAssetDefinition.UsmExtension;

                if (File.Exists(filePath))
                {
                    var movieInfo = new ManaInfo(filePath);

                    observer.OnNext(movieInfo);

                    if (onLoadAsset != null)
                    {
                        onLoadAsset.OnNext(resourcePath);
                    }
                }
                else
                {
                    Debug.LogErrorFormat("File not found.\n{0}", filePath);

                    observer.OnError(new FileNotFoundException(filePath));
                }
            }

            observer.OnCompleted();
        }
Exemplo n.º 17
0
        private IEnumerator TransitionCore <TArgument>(TArgument sceneArgument, LoadSceneMode mode, bool isSceneBack, bool registerHistory) where TArgument : ISceneArgument
        {
            if (!sceneArgument.Identifier.HasValue)
            {
                yield break;
            }

            // プリロード停止.
            if (preLoadDisposable != null)
            {
                preLoadDisposable.Dispose();
                preLoadDisposable = null;
            }

            TransitionTarget = sceneArgument.Identifier;

            var prevSceneArgument = currentSceneArgument;

            currentSceneArgument = sceneArgument;

            var diagnostics = new TimeDiagnostics();

            var prev = current;

            // 現在のシーンを履歴に残さない場合は、既に登録済みの現在のシーン(history[要素数 - 1])を外す.
            if (!registerHistory && history.Any())
            {
                history.RemoveAt(history.Count - 1);
            }

            //====== Begin Transition ======

            diagnostics.Begin(TimeDiagnostics.Measure.Total);

            yield return(TransitionStart(currentSceneArgument).ToYieldInstruction());

            if (prev != null)
            {
                //====== Scene Leave ======

                diagnostics.Begin(TimeDiagnostics.Measure.Leave);

                // Leave通知.
                if (onLeave != null)
                {
                    onLeave.OnNext(prevSceneArgument);
                }

                // 現在のシーンの終了処理を実行.
                yield return(prev.Instance.LeaveAsync().ToYieldInstruction());

                // PlayerPrefsを保存.
                PlayerPrefs.Save();

                // Leave終了通知.
                if (onLeaveComplete != null)
                {
                    onLeaveComplete.OnNext(prevSceneArgument);
                }

                prev.Disable();

                diagnostics.Finish(TimeDiagnostics.Measure.Leave);
            }

            //====== Scene Unload ======

            // 不要なシーンをアンロード.
            var unloadScenes = loadedscenes.Values
                               // 遷移先のシーンではない.
                               .Where(x => x.Identifier != TransitionTarget)
                               // SceneBaseクラスが存在しない.
                               .Where(x => UnityUtility.IsNull(x.Instance))
                               // キャッシュ対象でない.
                               .Where(x => cacheScenes.All(y => y != x))
                               // 次のシーンのPreload対象ではない.
                               .Where(x => currentSceneArgument.PreLoadScenes.All(y => y != x.Identifier))
                               .ToArray();

            foreach (var unloadScene in unloadScenes)
            {
                yield return(UnloadScene(unloadScene).ToYieldInstruction());

                if (unloadScene.Identifier.HasValue)
                {
                    loadedscenes.Remove(unloadScene.Identifier.Value);
                }
            }

            //====== Load Next Scene ======

            diagnostics.Begin(TimeDiagnostics.Measure.Load);

            // 次のシーンを読み込み.
            var identifier = sceneArgument.Identifier.Value;

            var sceneInfo = loadedscenes.GetValueOrDefault(identifier);

            if (sceneInfo == null)
            {
                var loadYield = LoadScene(identifier, mode).ToYieldInstruction();

                yield return(loadYield);

                if (!loadYield.HasResult)
                {
                    yield break;
                }

                sceneInfo = loadYield.Result;

                if (sceneArgument.Cache)
                {
                    cacheScenes.Enqueue(sceneInfo);
                }
            }

            var scene = sceneInfo.GetScene();

            if (!scene.HasValue)
            {
                Debug.LogErrorFormat("[ {0} ] : Scene情報の取得に失敗しました.", identifier);

                yield break;
            }

            if (sceneInfo.Instance == null)
            {
                Debug.LogErrorFormat("[ {0} ] : SceneBase継承クラスが存在しません.", scene.Value.path);

                yield break;
            }

            SetSceneActive(scene);

            // 前のシーンからの引数を設定.
            sceneInfo.Instance.SetArgument(sceneArgument);

            // 現在のシーンとして登録.
            current = sceneInfo;

            // 次のシーンを履歴に登録.
            // シーン引数を保存する為遷移時に引数と一緒に履歴登録する為、履歴の最後尾は現在のシーンになる.
            if (current.Instance != null)
            {
                history.Add(currentSceneArgument);
            }

            // シーン読み込み後にAwake、Startが終わるのを待つ為1フレーム後に処理を再開.
            yield return(null);

            diagnostics.Finish(TimeDiagnostics.Measure.Load);

            //====== Scene Prepare ======

            diagnostics.Begin(TimeDiagnostics.Measure.Prepare);

            // Prepar通知.
            if (onPrepare != null)
            {
                onPrepare.OnNext(currentSceneArgument);
            }

            // 次のシーンの準備処理実行.
            if (current.Instance != null)
            {
                yield return(current.Instance.Prepare(isSceneBack).ToYieldInstruction());
            }

            // Prepar終了通知.
            if (onPrepareComplete != null)
            {
                onPrepareComplete.OnNext(currentSceneArgument);
            }

            diagnostics.Finish(TimeDiagnostics.Measure.Prepare);

            //====== Unload PrevScene ======

            // キャッシュ対象でない場合はアンロード.
            if (prevSceneArgument == null || !prevSceneArgument.Cache)
            {
                yield return(UnloadScene(prev).ToYieldInstruction());
            }

            //====== Scene Wait ======

            // メモリ解放.
            yield return(CleanUp().ToYieldInstruction());

            // 外部処理待機.
            yield return(Observable.FromMicroCoroutine(() => TransitionWait()).ToYieldInstruction());

            // シーンを有効化.
            sceneInfo.Enable();

            // シーン遷移完了.
            TransitionTarget = null;

            // シーン遷移終了.
            yield return(TransitionFinish(currentSceneArgument).ToYieldInstruction());

            //====== Scene Enter ======

            // Enter通知.
            if (onEnter != null)
            {
                onEnter.OnNext(currentSceneArgument);
            }

            // 次のシーンの開始処理実行.
            if (current.Instance != null)
            {
                current.Instance.Enter(isSceneBack);
            }

            // Enter終了通知.
            if (onEnterComplete != null)
            {
                onEnterComplete.OnNext(currentSceneArgument);
            }

            //====== Report ======

            diagnostics.Finish(TimeDiagnostics.Measure.Total);

            var prevScene = prev.Identifier;
            var nextScene = current.Identifier;

            var total  = diagnostics.GetTime(TimeDiagnostics.Measure.Total);
            var detail = diagnostics.BuildDetailText();

            UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "{0} → {1} ({2:F2}ms)\n\n{3}", prevScene, nextScene, total, detail);

            //====== PreLoad ======

            preLoadDisposable = PreLoadScene(sceneArgument.PreLoadScenes)
                                .Subscribe(_ => preLoadDisposable = null)
                                .AddTo(Disposable);
        }
        public static void Build(string externalResourcesPath, AssetManageConfig assetManageConfig)
        {
            var exportPath = GetExportPath();

            if (string.IsNullOrEmpty(exportPath))
            {
                return;
            }

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

            EditorApplication.LockReloadAssemblies();

            try
            {
                // アセット情報ファイルを生成.
                var assetInfoManifest = AssetInfoManifestGenerator.Generate(externalResourcesPath, assetManageConfig);

                // キャッシュ済みアセットバンドルのハッシュ値取得.
                var cachedAssetBundleHashs = BuildAssetBundle.GetCachedAssetBundleHash();

                // CRIアセットを生成.
                #if ENABLE_CRIWARE_ADX || ENABLE_CRIWARE_SOFDEC
                CriAssetGenerator.Generate(exportPath, externalResourcesPath, assetInfoManifest);
                #endif

                // AssetBundleをビルド.
                var assetBundleManifest = BuildAssetBundle.BuildAllAssetBundles();

                // 不要になった古いAssetBundle削除.
                BuildAssetBundle.CleanUnUseAssetBundleFiles();

                // ビルド成果物の情報をAssetInfoManifestに書き込み.

                var assetBundlePath = BuildAssetBundle.GetAssetBundleOutputPath();

                AssetInfoManifestGenerator.SetAssetBundleFileInfo(assetBundlePath, externalResourcesPath, assetBundleManifest);

                #if ENABLE_CRIWARE_ADX || ENABLE_CRIWARE_SOFDEC
                AssetInfoManifestGenerator.SetCriAssetFileInfo(exportPath, externalResourcesPath, assetBundleManifest);
                #endif

                // アセットバンドルの参照情報をAssetInfoManifestに書き込み.
                BuildAssetBundle.SetDependencies(assetInfoManifest, assetBundleManifest);

                // 再度AssetInfoManifestだけビルドを実行.
                BuildAssetBundle.BuildAssetInfoManifest(externalResourcesPath);

                // 更新が必要なパッケージファイルを削除.
                BuildAssetBundle.CleanOldPackage(cachedAssetBundleHashs);

                // AssetBundleファイルをパッケージ化.
                BuildAssetBundle.BuildPackage(exportPath, assetInfoManifest, assetManageConfig.CryptPassword);

                // 出力先フォルダを開く.
                UnityEditorUtility.OpenFolder(exportPath);

                UnityConsole.Event(ExternalResources.ConsoleEventName, ExternalResources.ConsoleEventColor, "Build ExternalResource Complete.");
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                throw;
            }
            finally
            {
                EditorApplication.UnlockReloadAssemblies();
            }
        }
Exemplo n.º 19
0
        private IEnumerator LoadAssetInternal <T>(IObserver <T> observer, string resourcesPath, bool autoUnload) where T : UnityEngine.Object
        {
            System.Diagnostics.Stopwatch sw = null;

            T result = null;

            if (assetInfoManifest == null)
            {
                var exception = new Exception("AssetInfoManifest is null.");

                Debug.LogException(exception);

                if (onError != null)
                {
                    onError.OnNext(exception);
                }

                observer.OnError(exception);

                yield break;
            }

            var assetInfo = GetAssetInfo(resourcesPath);

            if (assetInfo == null)
            {
                var exception = new Exception(string.Format("AssetInfo not found.\n{0}", resourcesPath));

                Debug.LogException(exception);

                if (onError != null)
                {
                    onError.OnNext(exception);
                }

                observer.OnError(exception);

                yield break;
            }

            var assetPath = PathUtility.Combine(resourceDir, resourcesPath);

            var assetBundleName = assetInfo.AssetBundle.AssetBundleName;

            // ローカルバージョンが古い場合はダウンロード.
            if (!CheckAssetBundleVersion(assetBundleName))
            {
                var downloadYield = UpdateAsset(resourcesPath).ToYieldInstruction(false, yieldCancell.Token);

                // 読み込み実行 (読み込み中の場合は読み込み待ちのObservableが返る).
                sw = System.Diagnostics.Stopwatch.StartNew();

                yield return(downloadYield);

                if (downloadYield.HasError)
                {
                    Debug.LogException(downloadYield.Error);

                    if (onError != null)
                    {
                        onError.OnNext(downloadYield.Error);
                    }

                    observer.OnError(downloadYield.Error);
                }

                sw.Stop();

                var builder = new StringBuilder();

                builder.AppendFormat("Update: {0} ({1:F2}ms)", Path.GetFileName(assetPath), sw.Elapsed.TotalMilliseconds).AppendLine();
                builder.AppendLine();
                builder.AppendFormat("LoadPath = {0}", assetPath).AppendLine();
                builder.AppendFormat("AssetBundleName = {0}", assetBundleName).AppendLine();
                builder.AppendFormat("Hash = {0}", assetInfo.FileHash).AppendLine();

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
            }

            var isLoading = loadingAssets.Contains(assetInfo);

            if (!isLoading)
            {
                loadingAssets.Add(assetInfo);
            }

            // 読み込み実行 (読み込み中の場合は読み込み待ちのObservableが返る).
            sw = System.Diagnostics.Stopwatch.StartNew();

            var loadYield = assetBundleManager.LoadAsset <T>(assetBundleName, assetPath, autoUnload).ToYieldInstruction();

            yield return(loadYield);

            result = loadYield.Result;

            sw.Stop();

            if (loadingAssets.Contains(assetInfo))
            {
                loadingAssets.Remove(assetInfo);
            }

            // 読み込み中だった場合はログを表示しない.
            if (result != null && !isLoading)
            {
                var builder = new StringBuilder();

                builder.AppendFormat("Load: {0} ({1:F2}ms)", Path.GetFileName(assetPath), sw.Elapsed.TotalMilliseconds).AppendLine();
                builder.AppendLine();
                builder.AppendFormat("LoadPath = {0}", assetPath).AppendLine();
                builder.AppendFormat("AssetBundleName = {0}", assetBundleName).AppendLine();
                builder.AppendFormat("Hash = {0}", assetInfo.FileHash).AppendLine();

                if (!string.IsNullOrEmpty(assetInfo.GroupName))
                {
                    builder.AppendFormat("Group = {0}", assetInfo.GroupName).AppendLine();
                }

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
            }

            observer.OnNext(result);
            observer.OnCompleted();
        }
Exemplo n.º 20
0
        private IEnumerator LoadAssetInternal <T>(IObserver <T> observer, string resourcePath, bool autoUnload) where T : UnityEngine.Object
        {
            System.Diagnostics.Stopwatch sw = null;

            T result = null;

            if (assetInfoManifest == null)
            {
                var exception = new Exception("AssetInfoManifest is null.");

                OnError(exception);

                observer.OnError(exception);

                yield break;
            }

            var assetInfo = GetAssetInfo(resourcePath);

            if (assetInfo == null)
            {
                var exception = new Exception(string.Format("AssetInfo not found.\n{0}", resourcePath));

                OnError(exception);

                observer.OnError(exception);

                yield break;
            }

            // 外部処理.

            if (instance.loadAssetHandler != null)
            {
                var loadRequestYield = instance.loadAssetHandler
                                       .OnLoadRequest(assetInfo)
                                       .ToYieldInstruction(false, yieldCancel.Token);

                while (!loadRequestYield.IsDone)
                {
                    yield return(null);
                }

                if (loadRequestYield.HasError)
                {
                    OnError(loadRequestYield.Error);

                    observer.OnError(loadRequestYield.Error);

                    yield break;
                }
            }

            // 読み込み.

            var assetPath = GetAssetPathFromAssetInfo(resourceDirectory, shareDirectory, assetInfo);

            if (!LocalMode && !simulateMode)
            {
                // ローカルバージョンが古い場合はダウンロード.
                if (!CheckAssetBundleVersion(assetInfo))
                {
                    var downloadYield = UpdateAsset(resourcePath).ToYieldInstruction(false, yieldCancel.Token);

                    // 読み込み実行 (読み込み中の場合は読み込み待ちのObservableが返る).
                    sw = System.Diagnostics.Stopwatch.StartNew();

                    while (!downloadYield.IsDone)
                    {
                        yield return(null);
                    }

                    if (downloadYield.HasError)
                    {
                        OnError(downloadYield.Error);

                        observer.OnError(downloadYield.Error);

                        yield break;
                    }

                    sw.Stop();

                    if (LogEnable && UnityConsole.Enable)
                    {
                        var builder = new StringBuilder();

                        var assetBundleName = assetInfo.AssetBundle.AssetBundleName;

                        builder.AppendFormat("Update: {0} ({1:F2}ms)", Path.GetFileName(assetPath), sw.Elapsed.TotalMilliseconds).AppendLine();
                        builder.AppendLine();
                        builder.AppendFormat("LoadPath = {0}", assetPath).AppendLine();
                        builder.AppendFormat("FileName = {0}", assetInfo.FileName).AppendLine();
                        builder.AppendFormat("AssetBundleName = {0}", assetBundleName).AppendLine();

                        if (!string.IsNullOrEmpty(assetInfo.Hash))
                        {
                            builder.AppendFormat("Hash = {0}", assetInfo.Hash).AppendLine();
                        }

                        UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
                    }
                }
            }

            var isLoading = loadingAssets.Contains(assetInfo);

            if (!isLoading)
            {
                loadingAssets.Add(assetInfo);
            }

            // 時間計測開始.

            sw = System.Diagnostics.Stopwatch.StartNew();

            // 読み込み実行 (読み込み中の場合は読み込み待ちのObservableが返る).

            var loadYield = assetBundleManager.LoadAsset <T>(assetInfo, assetPath, autoUnload).ToYieldInstruction();

            while (!loadYield.IsDone)
            {
                yield return(null);
            }

            result = loadYield.Result;

            // 読み込み中リストから外す.

            if (loadingAssets.Contains(assetInfo))
            {
                loadingAssets.Remove(assetInfo);
            }

            // 外部処理.

            if (instance.loadAssetHandler != null)
            {
                var loadFinishYield = instance.loadAssetHandler
                                      .OnLoadFinish(assetInfo)
                                      .ToYieldInstruction(false, yieldCancel.Token);

                while (!loadFinishYield.IsDone)
                {
                    yield return(null);
                }

                if (loadFinishYield.HasError)
                {
                    OnError(loadFinishYield.Error);

                    observer.OnError(loadFinishYield.Error);

                    yield break;
                }
            }

            // 時間計測終了.

            sw.Stop();

            // 読み込み中だった場合はログを表示しない.
            if (result != null && !isLoading)
            {
                if (LogEnable && UnityConsole.Enable)
                {
                    var builder = new StringBuilder();

                    var assetBundleName = assetInfo.AssetBundle.AssetBundleName;

                    builder.AppendFormat("Load: {0} ({1:F2}ms)", Path.GetFileName(assetPath), sw.Elapsed.TotalMilliseconds).AppendLine();
                    builder.AppendLine();
                    builder.AppendFormat("LoadPath = {0}", assetPath).AppendLine();
                    builder.AppendFormat("AssetBundleName = {0}", assetBundleName).AppendLine();
                    builder.AppendFormat("Hash = {0}", assetInfo.Hash).AppendLine();

                    if (!string.IsNullOrEmpty(assetInfo.Category))
                    {
                        builder.AppendFormat("Category = {0}", assetInfo.Category).AppendLine();
                    }

                    if (assetInfo.AssetBundle.Dependencies.Any())
                    {
                        builder.AppendLine();
                        builder.AppendLine("Dependencies:");

                        foreach (var item in assetInfo.AssetBundle.Dependencies)
                        {
                            builder.AppendLine(item);
                        }
                    }

                    UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
                }

                if (onLoadAsset != null)
                {
                    onLoadAsset.OnNext(resourcePath);
                }
            }

            observer.OnNext(result);
            observer.OnCompleted();
        }
Exemplo n.º 21
0
        private SoundSheet GetSoundSheet(CueInfo cueInfo)
        {
            if (cueInfo == null)
            {
                return(null);
            }

            var assetPath  = cueInfo.FilePath;
            var soundSheet = managedSoundSheets.GetValueOrDefault(assetPath);

            if (soundSheet == null)
            {
                // パス情報生成.
                var acbPath = SoundSheet.AcbPath(assetPath);
                var awbPath = SoundSheet.AwbPath(assetPath);

                // ACBファイルのロード.
                CriAtomCueSheet cueSheet = null;

                try
                {
                    cueSheet = CriAtom.AddCueSheet(assetPath, acbPath, awbPath);
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                    return(null);
                }

                if (cueSheet.acb == null)
                {
                    return(null);
                }

                // ロードしたACBを保持した状態で再生成.
                soundSheet = new SoundSheet(assetPath, cueSheet.acb);

                managedSoundSheets.Add(soundSheet.AssetPath, soundSheet);


                if (LogEnable && UnityConsole.Enable)
                {
                    var builder = new StringBuilder();

                    builder.AppendFormat("Load : {0} : {1}", cueInfo.Cue, cueInfo.CueId).AppendLine();
                    builder.AppendLine();
                    builder.AppendFormat("Cue : {0}", cueInfo.Cue).AppendLine();
                    builder.AppendFormat("CueId : {0}", cueInfo.CueId).AppendLine();
                    builder.AppendFormat("FileName : {0}", Path.GetFileName(acbPath)).AppendLine();

                    if (!string.IsNullOrEmpty(cueInfo.Summary))
                    {
                        builder.AppendFormat("Summary: {0}", cueInfo.Summary).AppendLine();
                    }

                    UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
                }
            }

            return(soundSheet);
        }