VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
static float AVR.Core.AVR_Settings.get_float ( string  token)
inlinestatic

Get a registered setting of the type float.

Parameters
tokenToken identifying the given setting. A setting declared as domain = { setting = true } will be retrievable with the token /domain/setting.
Returns
Registered setting if a valid is found, otherwise 1.0.

Definition at line 110 of file AVR_Settings.cs.

110  {
111  if(settings.TryGetValue(token, out string ret)) {
112  return float.Parse(ret);
113  }
114  else if (!initialized)
115  {
116  initialize();
117  return get_float(token);
118  }
119  else {
120  AVR_DevConsole.warn("Settings do not contain key \""+token+"\". Using default value of 1.0f.");
121  return 1.0f;
122  }
123  }
static void initialize()
Initialize settings. Calling multiple times will have no effect, use reconfigure() if you want to re-...
Definition: AVR_Settings.cs:25
static Dictionary< string, string > settings
Dictionary containing all settings by their key. A setting declared as domain = { setting = true } wi...
Definition: AVR_Settings.cs:42
static bool initialized
Definition: AVR_Settings.cs:16
static float get_float(string token)
Get a registered setting of the type float.