private void PlayerPrefsManager_PreferenceChanged(PreferenceChangedEventArgs eventArgs)
 {
     if (eventArgs.PreferenceName == nameof(Preferences.MasterVolume))
     {
         _audioSource.volume = (float)eventArgs.Value;
     }
 }
Exemplo n.º 2
0
    void Test(object sender, PreferenceChangedEventArgs e)
    {
        Type         type = sender.GetType();
        PropertyInfo prop = type.GetProperty("TypeName");

        //check to see who sent the event
        Debug.Log("Test");
        Debug.Log(prop.GetValue(sender, null));
    }
Exemplo n.º 3
0
        protected virtual void OnPreferenceChanged(object sender, PreferenceChangedEventArgs e)
        {
            switch (e.Preference)
            {
            case Preference.ClientRetrievalTask:
                if (Preferences.Get <bool>(Preference.ClientRetrievalTaskEnabled))
                {
                    if (ClientConfiguration.Count != 0)
                    {
                        _clientRetrievalTask.Interval = ClientInterval;
                        _clientRetrievalTask.Restart();
                    }
                }
                else
                {
                    _clientRetrievalTask.Stop();
                }
                break;

            case Preference.WebGenerationTask:
                if (Preferences.Get <bool>(Preference.WebGenerationTaskEnabled) &&
                    Preferences.Get <bool>(Preference.WebGenerationTaskAfterClientRetrieval) == false)
                {
                    if (ClientConfiguration.Count != 0)
                    {
                        _webGenerationTask.Interval = WebInterval;
                        _webGenerationTask.Restart();
                    }
                }
                else
                {
                    _webGenerationTask.Stop();
                }
                break;
            }
        }
Exemplo n.º 4
0
        public void OnPreferenceChangedHandler(object sender, PreferenceChangedEventArgs args)
        {
            Debug.Log("Something happened to " + sender);

            OnPrefenceChanged?.Invoke(sender, args);
        }
 protected override void OnPreferenceChanged(object sender, PreferenceChangedEventArgs e)
 {
 }