예제 #1
0
 protected virtual void Stop(FMODAudioBase sound, bool immediate)
 {
     if (sound.IsActive)
     {
         sound.Stop(immediate);
     }
     else
     {
         //Debug.Log("Sound is not active - " + sound);
     }
 }
예제 #2
0
 protected virtual void Continue(FMODAudioBase sound)
 {
     if (sound.IsActive && !sound.IsPlaying)
     {
         sound.Continue();
     }
     else
     {
         //Debug.Log("Sound is not playing - " + sound);
     }
 }
예제 #3
0
 protected virtual void PlayAnyway(FMODAudioBase sound)
 {
     try
     {
         sound.PlayAnyway();
     }
     catch
     {
         Debug.LogError("Sound is MISSING!");
     }
 }
예제 #4
0
    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);
        }
    }
예제 #5
0
 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");
     }
 }
예제 #6
0
 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);
     }
 }