Example #1
0
    public void Load()
    {
        MusicEnabled        = LocalStorage.GetBool("MusicEnabled", musicEnabled);
        SoundEnabled        = LocalStorage.GetBool("SoundEnabled", soundEnabled);
        NotificationEnabled = LocalStorage.GetBool("NotificationEnabled", notificationEnabled);

        EventManager.Instance.DefineProperty <SettingMusicEvent>(() => { return(SettingMusicEvent.Create(musicEnabled)); });
        EventManager.Instance.DefineProperty <SettingSoundEvent>(() => { return(SettingSoundEvent.Create(soundEnabled)); });
        EventManager.Instance.DefineProperty <SettingNotificationEvent>(() => { return(SettingNotificationEvent.Create(notificationEnabled)); });
    }
Example #2
0
 private void OnMusic(SettingMusicEvent evt)
 {
     musicEnabled = evt.value;
     if (musicEnabled)
     {
         PlayBGM(BGM);
     }
     else
     {
         StopBGM();
     }
 }