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);

                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);
        }
Beispiel #2
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);
        }