public void CreateAxis(string name, string description, KeyCode key) { if (this.axis.ContainsKey(name)) { Debug.LogWarning("Axis named " + name + " already exists."); return; } Axis axis = new KeyAxis(name, description, key); this.axis.Add(name, axis); }
/// <summary> /// This edits the axis to be a KeyCode axis /// </summary> /// <param name="name">name of the axis</param> /// <param name="key">keycode for the axis</param> public void EditAxis(string name, KeyCode key) { Axis axis = null; if (this.axis.TryGetValue(name, out axis)) { Axis newAxis = new KeyAxis(name, axis.Description, key); this.axis[name] = newAxis; } else { Debug.LogWarning("There's no axis named " + name + "."); } }