Пример #1
0
        public virtual void PlayMusic(string musicClipName, float volume)
        {
            MusicVolume = volume;
            if (!MuteAllSound)
            {
                AudioClip musicClip = MusicPlaylist.FindByName(musicClipName);

                if (musicClip == null)
                {
                    GDebug.LogError("NO SOUNDTRACK " + musicClipName, this, LogCategory.SOUND_MANAGER);
                    GDebug.Log("Tried to play music : " + musicClipName + " but soundManager could not find it!", this, LogCategory.SOUND_MANAGER);
                    return;
                }

                //we have music playing already
                GDebug.Log("playing: " + musicClip.name, this, LogCategory.SOUND_MANAGER);
                DoMusicPlay(musicClip, volume);
            }
        }