protected virtual void Stop(FMODAudioBase sound, bool immediate) { if (sound.IsActive) { sound.Stop(immediate); } else { //Debug.Log("Sound is not active - " + sound); } }
protected virtual void Continue(FMODAudioBase sound) { if (sound.IsActive && !sound.IsPlaying) { sound.Continue(); } else { //Debug.Log("Sound is not playing - " + sound); } }
protected virtual void PlayAnyway(FMODAudioBase sound) { try { sound.PlayAnyway(); } catch { Debug.LogError("Sound is MISSING!"); } }
public void Play(KeyWord key) { string fullPath = _soundPath + ScriptManager.Instance.voiceLanguage + '/' + key.Main + '/' + key.FullWorld; try { FMOD.Studio.EventInstance sound = RuntimeManager.CreateInstance(fullPath); voice = new FMODAudio2D(this, sound); Play(voice); } catch { Debug.LogError("Неправильный путь - " + fullPath); } }
protected virtual void Play(FMODAudioBase sound) { try { if (!sound.IsPlaying) { sound.Play(); } else { //Debug.Log("Sound is already playing - " + sound); } } catch { Debug.LogError($"Sound \"{sound}\" is MISSING"); } }
protected void AddSound2D(string name) { try { if (!FMODsounds.ContainsKey(name)) { FMOD.Studio.EventInstance sound = RuntimeManager.CreateInstance(_soundPath + name); FMODAudioBase audio = new FMODAudioBase(this, sound); FMODsounds.Add(name, audio); } else { Debug.LogError("Sound is Already Added - " + name); } } catch { Debug.LogError("ERROR in adding Sound - " + name); } }