void RemoteSettingsUpdated() { for (int i = 0; i < m_DriveableProperty.fields.Count; i++) { var f = m_DriveableProperty.fields[i]; if (!string.IsNullOrEmpty(f.rsKeyName) && RS.HasKey(f.rsKeyName) && f.target != null && !string.IsNullOrEmpty(f.fieldPath)) { //Type doesn't work with a switch, so let's do it this way if (f.type == "bool") { f.SetValue(RS.GetBool(f.rsKeyName)); } else if (f.type == "float") { f.SetValue(RS.GetFloat(f.rsKeyName)); } else if (f.type == "int") { f.SetValue(RS.GetInt(f.rsKeyName)); } else if (f.type == "string") { f.SetValue(RS.GetString(f.rsKeyName)); } } } }
private void AfterChecked(bool wasUpdatedFromServer, bool settingsChanged, int serverResponse) { Latest_Build = RS.GetInt("Latest_Build"); if (Latest_Build > current_build) { updateCanvas.SetActive(true); StartCoroutine(AnimateVisualTrick()); gameObject.SetActive(false); } }
public static object GetObject(Type type, string key = "") { if (type == null) { throw new ArgumentNullException(nameof(type)); } if (type.IsAbstract || type.IsSubclassOf(typeof(Object))) { throw new ArgumentException("Cannot deserialize to new instances of type '" + type.Name + ".'"); } return(RemoteSettings.GetAsScriptingObject(type, (object)null, key)); }
static public int constructor(IntPtr l) { try { UnityEngine.RemoteSettings o; o = new UnityEngine.RemoteSettings(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
public static object GetObject(string key, object defaultValue) { if (defaultValue == null) { throw new ArgumentNullException(nameof(defaultValue)); } Type type = defaultValue.GetType(); if (type.IsAbstract || type.IsSubclassOf(typeof(Object))) { throw new ArgumentException("Cannot deserialize to new instances of type '" + type.Name + ".'"); } return(RemoteSettings.GetAsScriptingObject(type, defaultValue, key)); }
public static float GetFloat(string key) { return(RemoteSettings.GetFloat(key, 0f)); }
public static long GetLong(string key) { return(RemoteSettings.GetLong(key, 0L)); }
public static int GetInt(string key) { return(RemoteSettings.GetInt(key, 0)); }
public static IDictionary <string, object> GetDictionary(string key = "") { RemoteSettings.UseSafeLock(); IDictionary <string, object> dictionary = RemoteConfigSettingsHelper.GetDictionary(RemoteSettings.GetSafeTopMap(), key); RemoteSettings.ReleaseSafeLock(); return(dictionary); }
public static T GetObject <T>(string key = "") { return((T)((object)RemoteSettings.GetObject(typeof(T), key))); }
public static bool GetBool(string key) { return(RemoteSettings.GetBool(key, false)); }
public static string GetString(string key) { return(RemoteSettings.GetString(key, "")); }
public static bool GetBool(string key) { bool defaultValue = false; return(RemoteSettings.GetBool(key, defaultValue)); }
public static string GetString(string key) { string defaultValue = ""; return(RemoteSettings.GetString(key, defaultValue)); }
public static float GetFloat(string key) { float defaultValue = 0f; return(RemoteSettings.GetFloat(key, defaultValue)); }
public static int GetInt(string key) { int defaultValue = 0; return(RemoteSettings.GetInt(key, defaultValue)); }