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)); } } } }
public static float GetFloat(string key) { return(RemoteSettings.GetFloat(key, 0f)); }
public static float GetFloat(string key) { float defaultValue = 0f; return(RemoteSettings.GetFloat(key, defaultValue)); }