setMute() public méthode

public setMute ( bool mute ) : RESULT
mute bool
Résultat RESULT
Exemple #1
0
 private void Start()
 {
     music.setVolume(PlayerPrefs.GetFloat("MusicVolume"));
     Sounds.setVolume(PlayerPrefs.GetFloat("SoundsVolume"));
     if (PlayerPrefs.GetInt("isMute") == 0)
     {
         Master.setMute(false);
     }
     else if (PlayerPrefs.GetInt("isMute") == 1)
     {
         Master.setMute(true);
     }
 }
    public void MuteAudio(bool isMuted)
    {
        mute = isMuted;

        MasterBus.setMute(mute);
        MusicBus.setMute(mute);
        SoundsBus.setMute(mute);

        PlayerPrefs.Save();
    }
Exemple #3
0
    void Start()
    {
        FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
        system.getBus("bus:/", out masterBus);

        if (!PlayerPrefs.HasKey("muted"))
        {
            PlayerPrefs.SetInt("muted", 0);
        }

        if (PlayerPrefs.GetInt("muted") == 1)
        {
            masterBus.setMute(true);
            sounds.GetComponent <Image>().sprite = spriteSoundOff;
        }
        else if (PlayerPrefs.GetInt("muted") == 0)
        {
            masterBus.setMute(false);
            sounds.GetComponent <Image>().sprite = spriteSoundOn;
        }
    }
Exemple #4
0
    // Use this for initialization
    void Start()
    {
        //gc = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController> ();
        FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
        system.getBus("bus:/", out masterBus);

        if (!PlayerPrefs.HasKey("muted"))
        {
            PlayerPrefs.SetInt("muted", 0);
        }

        if (PlayerPrefs.GetInt("muted") == 1)
        {
            masterBus.setMute(true);
            sounds.GetComponent <SpriteRenderer>().sprite = spriteSoundOff;
        }
        else if (PlayerPrefs.GetInt("muted") == 0)
        {
            masterBus.setMute(false);
            sounds.GetComponent <SpriteRenderer>().sprite = spriteSoundOn;
        }
    }
Exemple #5
0
    void Start()
    {
        scoretime = GameObject.Find("Text").GetComponent <Text>();
        sounds    = GameObject.Find("Mute");
        vicObj    = Resources.Load("Prefabs/effects/prtclVictory") as GameObject;
        timer     = GameObject.Find("Timer").GetComponent <GameTimer> ();
        camobj    = GameObject.FindGameObjectWithTag("MainCamera");
        camera    = camobj.GetComponent <Camera> ();
        vicObj.transform.localScale = new Vector3(1f, 1f, 1f) * (camera.orthographicSize / (5.5f));
        victory = vicObj.GetComponent <ParticleSystem> ();
        camera.nearClipPlane = 0.0f;
        vicpos = camera.transform.position + new Vector3(0f, -10f, 0f);
        Instantiate(playmat);
        StartCoroutine(WaitForPlaymatToLoad());
        timer.StartTimer();

        FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
        system.getBus("bus:/", out masterBus);

        if (!PlayerPrefs.HasKey("muted"))
        {
            PlayerPrefs.SetInt("muted", 0);
        }

        if (PlayerPrefs.GetInt("muted") == 1)
        {
            masterBus.setMute(true);
            sounds.GetComponent <SpriteRenderer>().sprite = spriteSoundOff;
        }
        else if (PlayerPrefs.GetInt("muted") == 0)
        {
            masterBus.setMute(false);
            sounds.GetComponent <SpriteRenderer>().sprite = spriteSoundOn;
        }
        scoretime.text = "Score: " + playmat.GetComponent <Playmat> ().Points + "/" + playmat.GetComponent <Playmat> ().TotalPoints.ToString();
    }
Exemple #6
0
    /// <summary>
    /// <paramref name="mute"/> → TRUE for turning off audio. FALSE for turning it back on.
    /// </summary>
    public void MuteAudio(AudioBusses busToMute, bool mute)
    {
        switch (busToMute)
        {
        case AudioBusses.MainBus:
            masterBus.setMute(mute);
            break;

        case AudioBusses.MusicBus:
            musicBus.setMute(mute);
            break;

        case AudioBusses.SfxBus:
            sfxBus.setMute(mute);
            break;

        default:
            break;
        }
    }
    private void Start()
    {
        //Debug.Log("MasterVol Pref " + PlayerPrefs.GetFloat("MasterVol"));
        //Debug.Log("MusicVol Pref " + PlayerPrefs.GetFloat("MusicVol"));
        //Debug.Log("SoundsVol Pref " + PlayerPrefs.GetFloat("SoundsVol"));

        MasterBus = RuntimeManager.GetBus("bus:/Master");
        MusicBus  = RuntimeManager.GetBus("bus:/Master/Music");
        SoundsBus = RuntimeManager.GetBus("bus:/Master/Sounds");

        MasterBusVol = PlayerPrefs.GetFloat("MasterVol");
        MusicBusVol  = PlayerPrefs.GetFloat("MusicVol");
        SoundsBusVol = PlayerPrefs.GetFloat("SoundsVol");
        mute         = PlayerPrefs.GetString("IsMuted") == "True" ? true : false;

        if (mute)
        {
            MasterBus.setMute(mute);
            MusicBus.setMute(mute);
            SoundsBus.setMute(mute);
        }

        soundsVolTest = "event:/UI/UI_MenuSelection";
    }
Exemple #8
0
 /// <summary>
 /// sets if master bus is mute
 /// </summary>
 public void Mute(FMOD.Studio.Bus bus_, bool mute_)
 {
     bus_.setMute(mute_);
 }
Exemple #9
0
 public void MuteMusic()
 {
     Master.setMute(true);
     PlayerPrefs.SetInt("isMute", 1);
 }