public GUIFunction(string name, InputDevice bindingDevice, string defaultButtonName) { this.eventName = name; bindingDevice.Bind(defaultButtonName, 0, ButtonCommand.Down, this); //if there is no default function, it's this now if (GUIFunction.defaultFunction == null) { GUIFunction.defaultFunction = this; } GUIFunction.guiFunctions.Add(this); }
/// <summary> /// Creates a new gui function with the given name, binds it to the named button on the given device. /// </summary> /// <param name="name">The GUI Function's name</param> /// <param name="bindingDevice">The Input Device to bind to.</param> /// <param name="defaultButtonName"></param> public GUIFunction(string name, InputDevice bindingDevice, string defaultButtonName, ButtonCommand buttonCommand) { if (GUIFunction.GetByName(name) != null) { Debug.log("Warning! GUI Function with this name already exists! You really need a factory!"); } this.eventName = name; bindingDevice.Bind(defaultButtonName, 0, buttonCommand, this); //if there is no default function, it's this now if (GUIFunction.defaultFunction == null) { GUIFunction.defaultFunction = this; } GUIFunction.guiFunctions.Add(this); }