Ejemplo n.º 1
0
 private void Start()
 {
     if (playerOnStart)
     {
         EazySoundManager.PlayMusic(targetMusic, relativeVolume, looping, persist);
     }
 }
Ejemplo n.º 2
0
 void Start()
 {
     if (Music)
     {
         EazySoundManager.PlayMusic(Music, 0.25f, true, false, 1, 1);
     }
 }
Ejemplo n.º 3
0
 public void PlayMusic()
 {
     if (!IsLocked)
     {
         EazySoundManager.PlayMusic(Music, 0.25f, true, false, 1, 1);
     }
 }
Ejemplo n.º 4
0
    public void SwitchToTracks()
    {
        var random = new System.Random();

        EazySoundManager.StopAllMusic(1f);
        EazySoundManager.PlayMusic(Tracks[random.Next(Tracks.Length - 1)]);
    }
Ejemplo n.º 5
0
        private void Start()
        {
            SceneManager.LoadScene("Init");
            if (Test > 0)
            {
                MaxPassLevel = Test;
            }
            UIDispatcher.Instance.AddEventListen(ConstDefine.MusicSetting, OnMusicSetting);
            int id = EazySoundManager.PlayMusic(BGM, 1, true, false, 1, 1);

            m_Audio         = EazySoundManager.GetMusicAudio(id);
            m_Audio.Persist = true;
        }
Ejemplo n.º 6
0
 public void SetMusic()
 {
     if (IsPlaySound)
     {
         EazySoundManager.GlobalSoundsVolume   = 1;
         EazySoundManager.GlobalUISoundsVolume = 1;
         EazySoundManager.PlayMusic(BGM, 1, true, false, 1, 1);
     }
     else
     {
         EazySoundManager.GlobalSoundsVolume   = 0;
         EazySoundManager.GlobalUISoundsVolume = 0;
         EazySoundManager.StopAll(1);
     }
 }
Ejemplo n.º 7
0
    public int PlayMusic(AudioClip clip, float volume = 0, bool loop = true, float pitch = 1)
    {
        if (!Application.isPlaying)
        {
            return(-1);
        }

        var id        = EazySoundManager.PlayMusic(clip, volume, loop, true);
        var eazyAudio = EazySoundManager.GetMusicAudio(id);

        eazyAudio.Pitch = pitch;

        _musicPlaying = id;

        return(id);
    }
Ejemplo n.º 8
0
    private void Play(AudioType type, AudioClip clip)
    {
        switch (type)
        {
        case AudioType.MUSIC:
            EazySoundManager.PlayMusic(clip);
            break;

        case AudioType.SOUND:
            EazySoundManager.PlaySound(clip);
            break;

        case AudioType.UISOUND:
            EazySoundManager.PlayUISound(clip);
            break;
        }
    }
    private void OnClickAudioBtn(bool isPlay)
    {
        if (isPlay)
        {
            EazySoundManager.GlobalSoundsVolume   = 1;
            EazySoundManager.GlobalUISoundsVolume = 1;
            EazySoundManager.PlayMusic(m_Musics[0], 1, true, false, 1, 1);
        }
        else
        {
            EazySoundManager.GlobalSoundsVolume   = 0;
            EazySoundManager.GlobalUISoundsVolume = 0;
            EazySoundManager.StopAll(1);
        }

        GlobalInit.Instance.IsPlaySound = isPlay;
    }
Ejemplo n.º 10
0
        public void SetMusic(bool isPlay, AudioClip musicClip)
        {
            if (isPlay)
            {
                EazySoundManager.GlobalSoundsVolume   = 1;
                EazySoundManager.GlobalUISoundsVolume = 1;
                EazySoundManager.PlayMusic(musicClip, 1, true, false, 1, 1);
            }
            else
            {
                EazySoundManager.GlobalSoundsVolume   = 0;
                EazySoundManager.GlobalUISoundsVolume = 0;
                EazySoundManager.StopAll(1);
            }

            Global.Instance.IsPlaySound = isPlay;
        }
Ejemplo n.º 11
0
    public void PlayMusic2()
    {
        EazySoundDemoAudioControls audioControl = AudioControls[1];

        if (audioControl.audio == null)
        {
            int audioID = EazySoundManager.PlayMusic(audioControl.audioclip, audioControl.volumeSlider.value, true, false);
            AudioControls[1].audio = EazySoundManager.GetAudio(audioID);
        }
        else if (audioControl.audio != null && audioControl.audio.Paused)
        {
            audioControl.audio.Resume();
        }
        else
        {
            audioControl.audio.Play();
        }
    }
Ejemplo n.º 12
0
 public void SetMusic()
 {
     if (IsPlaySound)
     {
         if (m_BGAudio == null)
         {
             int id = EazySoundManager.PlayMusic(BGClip);
             m_BGAudio = EazySoundManager.GetAudio(id);
         }
         EazySoundManager.GlobalSoundsVolume   = 1;
         EazySoundManager.GlobalUISoundsVolume = 1;
         m_BGAudio.Play();
     }
     else
     {
         EazySoundManager.GlobalSoundsVolume   = 0;
         EazySoundManager.GlobalUISoundsVolume = 0;
         EazySoundManager.StopAll(1);
     }
 }
Ejemplo n.º 13
0
 // Start is called before the first frame update
 void Start()
 {
     BGMusicID = EazySoundManager.PlayMusic(audios[0].audioClip, 1, true, false);
 }
 //--------------------------------------------------------------
 private void Start()
 {
     int backgroundMusicID = EazySoundManager.PlayMusic(musicAudioClip, 0.7f, true, false, 1, 1);
 }
 public void PlayMusic()
 {
     currentMusicId = EazySoundManager.PlayMusic(dict_AudioClips[AudioTag.MAIN_THEME], music_Volume, true, false);
 }
Ejemplo n.º 16
0
 public int PlayMusic(AudioClip clip, float volume = 1, bool loop = true, bool persist = true)
 {
     return(EazySoundManager.PlayMusic(clip, volume, loop, persist));
 }
Ejemplo n.º 17
0
 public int PlayMusic(AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds, float currentMusicfadeOutSeconds, Transform sourceTransform)
 {
     return(EazySoundManager.PlayMusic(clip, volume, loop, persist, fadeInSeconds, fadeOutSeconds, currentMusicfadeOutSeconds, sourceTransform));
 }
Ejemplo n.º 18
0
 public void PlayMusic()
 {
     EazySoundManager.PlayMusic(music, 0.5f, true, true);
 }
Ejemplo n.º 19
0
 public void SwitchToMenu()
 {
     EazySoundManager.PlayMusic(Menu);
 }
Ejemplo n.º 20
0
 private void Start()
 {
     EazySoundManager.PlayMusic(Intro);
 }
Ejemplo n.º 21
0
 public void StartFightMusic()
 {
     EazySoundManager.StopAllMusic();
     EazySoundManager.PlayMusic((AudioClip)Resources.Load("Sounds/backgroundmusic"), 1f, true, false, 0f, 0f);
 }