Esempio n. 1
0
    /// <summary>
    /// Toggles the music status.
    /// </summary>
    public void ToggleMusicStatus()
    {
        isMusicEnabled = (isMusicEnabled) ? false : true;
        PlayerPrefs.SetInt("isMusicEnabled", (isMusicEnabled) ? 0 : 1);

        if (OnMusicStatusChangedEvent != null)
        {
            OnMusicStatusChangedEvent.Invoke(isMusicEnabled);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Inits the audio status.
    /// </summary>
    public void initAudioStatus()
    {
        isSoundEnabled = (PlayerPrefs.GetInt("isSoundEnabled", 0) == 0) ? true : false;
        isMusicEnabled = (PlayerPrefs.GetInt("isMusicEnabled", 0) == 0) ? true : false;

        if ((!isSoundEnabled) && (OnSoundStatusChangedEvent != null))
        {
            OnSoundStatusChangedEvent.Invoke(isSoundEnabled);
        }
        if ((!isMusicEnabled) && (OnMusicStatusChangedEvent != null))
        {
            OnMusicStatusChangedEvent.Invoke(isMusicEnabled);
        }
    }