private SoundElement GetSoundElement(CueInfo info, SoundType type) { // シート取得. var soundSheet = GetSoundSheet(info); if (soundSheet == null) { return(null); } // 再生するキューの名前を指定. player.SetCue(soundSheet.Acb, info.Cue); // 再生パラメータ設定. SetSoundParam(type); // セットされた音声データの再生準備を開始. var playback = player.Prepare(); // 再生失敗ならRemovedが返る. if (playback.GetStatus() == CriAtomExPlayback.Status.Removed) { return(null); } // デフォルトに戻す. SetSoundParam(); var element = new SoundElement(this, type, soundSheet, info, playback); return(element); }
/* プレビュ用:音声データ設定・再生関数 */ private void StartPreviewPlayer() { if (isPreviewReady == false) { PreparePreview(); } if (isPreviewReady == true) { if (previewAcb == null || lastCuesheet != this.source.cueSheet) { if (previewAcb != null) { previewAcb.Dispose(); previewAcb = null; } foreach (var cuesheet in atomComponent.cueSheets) { if (cuesheet.name == this.source.cueSheet) { strPreviewAcb = Path.Combine(CriWare.streamingAssetsPath, cuesheet.acbFile); strPreviewAwb = (cuesheet.awbFile == null) ? null : Path.Combine(CriWare.streamingAssetsPath, cuesheet.awbFile); previewAcb = CriAtomExAcb.LoadAcbFile(null, strPreviewAcb, strPreviewAwb); lastCuesheet = cuesheet.name; } } } if (previewAcb != null) { if (previewPlayer != null) { previewPlayer.SetCue(previewAcb, this.source.cueName); previewPlayer.SetVolume(this.source.volume); previewPlayer.SetPitch(this.source.pitch); previewPlayer.Loop(this.source.loop); previewPlayer.Start(); } else { Debug.LogWarning("[CRIWARE] Player is not ready. Please try reloading the inspector"); } } else { Debug.LogWarning("[CRIWARE] Specified cue sheet could not be found"); } } }