public InputAxe(InputAxe other) { Name = other.Name; Positive = new InputButton(other.Positive); Negative = new InputButton(other.Negative); Gravity = other.Gravity; Sensivity = other.Sensivity; Dead = other.Dead; value = 0f; }
public static void LoadSettings(string filepath) { FileInfo fileInf = new FileInfo(filepath); if (!fileInf.Exists) { LoadInitSettings(); return; } Axes = new List <InputAxe> () { }; XmlDocument xDoc = new XmlDocument(); xDoc.Load(filepath); XmlElement xRoot = xDoc.DocumentElement; if (xRoot.Name != "Axes") { return; } foreach (XmlNode xAxe in xRoot) { InputAxe newAxe = new InputAxe(); if (xAxe.Name == "Axe") { newAxe = InputAxe.Deserialize(xAxe); Axes.Add(newAxe); } } Buttons = new List <InputButton>() { }; foreach (var cur in Axes) { if (!string.IsNullOrWhiteSpace(cur.Positive.Name)) { Buttons.Add(cur.Positive); } if (!string.IsNullOrWhiteSpace(cur.Negative.Name)) { Buttons.Add(cur.Negative); } } }