private void OnDisable() { if (previewAcb != null) { previewAcb.Dispose(); previewAcb = null; } lastCuesheet = ""; if (previewPlayer != null) { previewPlayer.Dispose(); previewPlayer = null; } }
private void OnDisable() { #if CRI_UNITY_EDITOR_PREVIEW if (previewAcb != null) { previewAcb.Dispose(); previewAcb = null; } if (previewPlayer != null) { previewPlayer.Dispose(); previewPlayer = null; } #endif }
private void GetAcbInfoListCore(string searchPath, ref int acbIndex) { string[] files = System.IO.Directory.GetFiles(searchPath); foreach (string file in files) { if (System.IO.Path.GetExtension(file.Replace("\\", "/")) == ".acb") { AcbInfo acbInfo = new AcbInfo(System.IO.Path.GetFileNameWithoutExtension(file), acbIndex, "", System.IO.Path.GetFileName(file), "", ""); /* 指定したACBファイル名(キューシート名)を指定してキュー情報を取得 */ CriAtomExAcb acb = CriAtomExAcb.LoadAcbFile(null, file.Replace("\\", "/"), ""); if (acb != null) { /* キュー名リストの作成 */ CriAtomEx.CueInfo[] cueInfoList = acb.GetCueInfoList(); foreach (CriAtomEx.CueInfo cueInfo in cueInfoList) { CueInfo tmpCueInfo = new CueInfo(cueInfo.name, cueInfo.id, cueInfo.userData); bool found = false; foreach (var key in acbInfo.cueInfoList) { if (key.id == cueInfo.id) { found = true; break; } } if (found == false) { acbInfo.cueInfoList.Add(tmpCueInfo); } else { // inGame時のサブシーケンスの場合あり //Debug.Log("already exists in the dictionay id:" + cueInfo.id.ToString() +"name:" + cueInfo.name); } } acb.Dispose(); } else { Debug.Log("GetAcbInfoList LoadAcbFile. acb is null. " + file); } tmpAcbInfoList.Add(acbInfo); acbIndex++; } } // directory string[] directories = System.IO.Directory.GetDirectories(searchPath); foreach (string directory in directories) { GetAcbInfoListCore(directory, ref acbIndex); } }
private void GetAcbInfoListCore(string searchPath) { acbInfoList.Clear(); string[] files = null; try { files = Directory.GetFiles(searchPath, "*.acb", SearchOption.AllDirectories); } catch (Exception ex) { if (ex is ArgumentException || ex is ArgumentNullException) { Debug.LogWarning("[CRIWARE] Insufficient search path. Please check the path for file searching."); } else if (ex is DirectoryNotFoundException) { Debug.LogWarning("[CRIWARE] Search path not found: " + searchPath); } else { Debug.LogError("[CRIWARE] Error getting ACB files. Message: " + ex.Message); } } if (files == null) { return; } int acbIndex = 0; foreach (string file in files) { AcbInfo acbInfo = new AcbInfo( Path.GetFileNameWithoutExtension(file), acbIndex++, "", TryGetRelFilePath(file), TryGetAwbFile(file)); /* 指定したACBファイル名(キューシート名)を指定してキュー情報を取得 */ string acbFilePath = file.Replace("\\", "/"); CriAtomExAcb acb = CriAtomExAcb.LoadAcbFile(null, acbFilePath, ""); if (acb != null) { acbInfo.assetGuid = AssetDatabase.AssetPathToGUID("Assets" + acbFilePath.Substring(Application.dataPath.Length)); /* キュー名リストの作成 */ CriAtomEx.CueInfo[] cueInfoList = acb.GetCueInfoList(); foreach (CriAtomEx.CueInfo cueInfo in cueInfoList) { bool found = false; foreach (var key in acbInfo.cueInfoList) { if (key.id == cueInfo.id) { found = true; break; } } if (found == false) { var newCueInfo = new CueInfo(cueInfo.name, cueInfo.id, cueInfo.userData, Convert.ToBoolean(cueInfo.headerVisibility)); acbInfo.cueInfoList.Add(newCueInfo); if (newCueInfo.isPublic) { acbInfo.publicCueInfoList.Add(newCueInfo); } } else { /* inGame時のサブシーケンスの場合あり */ Debug.Log("[CRIWARE] Duplicate cue ID " + cueInfo.id.ToString() + " in cue sheet " + acbInfo.name + ". Last cue name:" + cueInfo.name); } } acb.Dispose(); } else { Debug.Log("[CRIWARE] Failed to load ACB file: " + file); } acbInfoList.Add(acbInfo); } }