//Save local values manually.
 public void SavePrefs()
 {
     setting.Set(SPEED_KEY, sSpeed);
     setting.Set(PITCH_KEY, sPitch);
     setting.Set(SPEED_STEP_KEY, speedStep);
     setting.Set(PITCH_STEP_KEY, pitchStep);
     Param.SetPlayerPrefs(SaveKey, setting);
     PlayerPrefs.Save();
 }
Esempio n. 2
0
        //Returns value when 'OK' pressed.
        private void ReceiveResult(string result)
        {
            Param param = Param.Parse(result);  //Parse: "key1=value1\nkey2=value2" -> same as Dictionary<key, value> (Param)

            if (param == null)
            {
                return;
            }

            if (saveValue)
            {
                SetValue(param);
                Param.SetPlayerPrefs(SaveKey, param);
                PlayerPrefs.Save();
            }

            if (OnResult != null)
            {
                OnResult.Invoke(param);     //Param and Dictionary are compatible.
            }
        }
Esempio n. 3
0
        //Returns value when 'OK' pressed.
        private void ReceiveResult(string result)
        {
            Param param = Param.Parse(result);  //Parse: "key1=value1\nkey2=value2" -> same as Dictionary<key, value> (Param)

            if (param == null)
            {
                return;
            }

            if (saveValue)
            {
                SetValue(param);
                Param.SetPlayerPrefs(SaveKey, param);
                PlayerPrefs.Save();
            }

            if (OnResult != null)
            {
                try {
                    OnResult.Invoke(param.Select(e => new { k = e.Key, v = float.Parse(e.Value) }).ToDictionary(a => a.k, a => a.v));
                }
                catch (Exception) { }
            }
        }
 //Save local values manually.
 public void SavePrefs()
 {
     setting.Set(LOCALE_KEY, Locale);
     Param.SetPlayerPrefs(SaveKey, setting);
     PlayerPrefs.Save();
 }
 //Save local values manually.
 public void SavePrefs()
 {
     setting.Set(LANGUAGE_KEY, Language);
     Param.SetPlayerPrefs(SaveKey, setting);
     PlayerPrefs.Save();
 }