private static void PassSectionToFunction(List <string> section, string section_name) { if (section_name.Equals(known_sections[0])) { Section_AutoSelect.Load(section); } if (section_name.Equals(known_sections[1])) { Section_JoystickCurve.Load(section); } //... }
public static void SaveActivePilot() { if (!PilotManager.Exists(PilotManager.ActivePilot)) { return; } try { string filepath = Path.Combine(Application.persistentDataPath, PilotManager.ActivePilot + file_extension); using (StreamWriter w = File.CreateText(filepath)) { w.WriteLine("[SECTION: AUTOSELECT]"); Section_AutoSelect.Save(w); w.WriteLine("[/END]"); w.WriteLine("[SECTION: JOYSTICKCURVE]"); Section_JoystickCurve.Save(w); w.WriteLine("[/END]"); //... if (unknown_sections != null) { foreach (string line in unknown_sections) { w.WriteLine(line); } } } } catch (Exception ex) { Debug.Log("Error in ExtendedConfig.SaveActivePilot(): " + ex); } }
public static void SetDefaultConfig() { Section_AutoSelect.Set(); Section_JoystickCurve.SetDefault(); }