/* * newDontRemoveExistsCueSheet == false の場合、古いキューシートを登録解除して、新しいキューシートの登録を行う。 * ただし同じキューシートの再登録は回避する */ private void MargeCueSheet(CriAtomCueSheet[] newCueSheets, bool newDontRemoveExistsCueSheet) { if (!newDontRemoveExistsCueSheet) { for (int i = 0; i < this.cueSheets.Length;) { int index = Array.FindIndex(newCueSheets, sheet => sheet.name == this.cueSheets[i].name); if (index < 0) { CriAtom.RemoveCueSheet(this.cueSheets[i].name); } else { i++; } } } foreach (var sheet1 in newCueSheets) { var sheet2 = this.GetCueSheetInternal(sheet1.name); if (sheet2 == null) { CriAtom.AddCueSheet(null, sheet1.acbFile, sheet1.awbFile, null); } } }
public void LoadCueSheet(string cueSheetName, int bgmCueId) { CriAtom.RemoveCueSheet(beforeBGMCueSheetName); beforeBGMCueSheetName = cueSheetName; CriAtom.AddCueSheet(beforeBGMCueSheetName, beforeBGMCueSheetName + ".acb", null, null); bgmSource.cueSheet = beforeBGMCueSheetName; bgmSource.volume = bgmVolume; bgmSource.Play(bgmCueId); }
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); }
public void LoadCpk() { CriPackageManager.I.LoadCPK("Common/common.cpk", (bool isSuceeded, CriPackageLoadController.BinderData data) => { //hoge CriAtom.AddCueSheet("Common/BGM", "Common/BGM.acb", "Common/BGM.awb", data.Binder); CriAtom.AddCueSheet("Common/SE", "Common/SE.acb", "", data.Binder); }); }
// Token: 0x060159CF RID: 88527 RVA: 0x005806AC File Offset: 0x0057E8AC public void CRIAddCueSheet(string sheetName, string acbFullPath, string awbFullPath) { if (CriAtom.GetCueSheet(sheetName) == null) { CriAtomCueSheet criAtomCueSheet = CriAtom.AddCueSheet(sheetName, acbFullPath, awbFullPath, null); if (criAtomCueSheet == null || (criAtomCueSheet.acbFile == string.Empty && criAtomCueSheet.awbFile == string.Empty)) { global::Debug.LogError(string.Format("Failed to add cue sheet: sheetName={0}, acbFullPath={1}, awbFullPath={2}", sheetName, acbFullPath, awbFullPath)); this.CRIRemoveCueSheet(sheetName); } } }
public static bool AddCueSheet(CriAtomCueSheet cueSheet) { if (cueSheet == null || string.IsNullOrEmpty(cueSheet.name)) { return(false); } CriAtom.AddCueSheet( cueSheet.name, cueSheet.acbFile, cueSheet.awbFile); return(true); }
public void LoadAcf() { beforeBGMCueSheetName = ""; atom = gameObject.AddComponent <CriAtom>(); atom.acfFile = "Star.acf"; CriAtom.AddCueSheet("Common", "Common.acb", null, null); seSource = gameObject.AddComponent <CriAtomSource>(); seSource.cueSheet = "Common"; seSource.volume = seVolume = 1f; bgmSource = gameObject.AddComponent <CriAtomSource>(); bgmSource.cueSheet = beforeBGMCueSheetName; bgmSource.volume = bgmVolume = 1f; }
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); }
public static IObservable <CriAtomCueSheet> AddCueSheet(CriAtomCueSheet cueSheet) { if (cueSheet == null) { throw new ArgumentException(); } if (string.IsNullOrEmpty(cueSheet.name)) { return(Observable.Return((CriAtomCueSheet)null)); } return(Observable .Return(CriAtom.AddCueSheet(cueSheet.name, cueSheet.acbFile, cueSheet.awbFile)) .SelectMany(x => Observable .EveryUpdate() .Where(_ => !x.IsLoading) .Select(_ => x)) .First()); }
// Use this for initialization void Start() { var criAtom = new GameObject("CRIAtom"); criAtom.AddComponent <CriAtom>(); CriAtom.AddCueSheet("CueSheet_0", "CueSheet_0.acb", ""); seAtomSource = gameObject.AddComponent <CriAtomSource> (); bgmAtomSource = gameObject.AddComponent <CriAtomSource> (); // 種別にSpectrumAnalyzerを指定 CriAtomExPlayerOutputAnalyzer.Type[] type = new CriAtomExPlayerOutputAnalyzer.Type[1]; //type[0] = CriAtomExPlayerOutputAnalyzer.Type.SpectrumAnalyzer; type[0] = CriAtomExPlayerOutputAnalyzer.Type.LevelMeter; // コンフィグでバンド数を指定 //CriAtomExPlayerOutputAnalyzer.Config[] config = new CriAtomExPlayerOutputAnalyzer.Config[1]; //config[0] = new CriAtomExPlayerOutputAnalyzer.Config(8); analyzer = new CriAtomExPlayerOutputAnalyzer(type, null); //config); bgmAtomSource.AttachToAnalyzer(analyzer); }