VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
static Dictionary<string, string> AVR.Core.AVR_SettingsParser.AutoParseSettingFiles ( bool  exclude_overridesettings = false)
inlinestatic

Automatically parse all settingsfiles found that have the *.avr suffix. Duplicate settings are overwritten in alphabetical order of the filename.

Parameters
exclude_overridesettingsIf set to true, any file with the name "~overridesettings.avr" will be excluded.
Returns
Dictionary of all settings.

Definition at line 18 of file AVR_SettingsParser.cs.

18  {
19  string[] files = System.IO.Directory.GetFiles(Application.dataPath+"/..", "*.avr", SearchOption.AllDirectories);
20  System.Array.Sort(files, (a, b) => string.Compare(b, a));
21 
22  Dictionary<string, string> entries = new Dictionary<string, string>();
23  foreach(string file in files) {
24  if(exclude_overridesettings && file.Contains("~overridesettings.avr")) continue;
25  entries = ParseSettings(file, entries);
26  }
27  return entries;
28  }
static Dictionary< string, string > ParseSettings(string filepath, Dictionary< string, string > entries=null)
Parse a single given settings-file.