public void OnClick() { if (OnButtonPress != null) { OnButtonPress.Invoke(null, null); } }
public void PressButton(object sender, ButtonPressEventArgs e) { if (OnButtonPress != null) { OnButtonPress.Invoke(sender, e); } }
void OnMultiPress(object sender, ButtonPressEventArgs args) { if (args.Event.Type != Gdk.EventType.TwoButtonPress) { OnButtonPress?.Invoke(this, args); return; } OnButtonDoublePress?.Invoke(this, args); }
public virtual void Update(GameTime gameTime) { var currentState = Keyboard.GetState(); foreach (var pair in Bindings) { if (currentState.IsKeyDown(pair.Key) && lastState.IsKeyUp(pair.Key)) { OnButtonPress?.Invoke(pair.Key, pair.Value); } } }
protected void NodeDataRecieved(object sender, NodeEvent eventData) { var val = int.Parse(eventData.Value.ToString()); // Seems to be the only way to get this? OnButtonPress?.Invoke(val); if (Handlers.ContainsKey(val)) { foreach (var handler in Handlers[val]) { handler(val); } } }
public void Disable() { GetComponent <Renderer>().material.color = disabledColor; foreach (ButtonCallBack b in OnButtonPress.GetInvocationList()) { OnButtonPress -= b; } HighlightOnRaycast highlight = GetComponent <HighlightOnRaycast>(); if (highlight != null) { Destroy(highlight); } }
/// <summary> /// Update the state of this element /// </summary> /// <param name="DeltaTime">Game clock.</param> public void Update(IFrameBasedClock clock) { while (currentState != null && currentState.Events.Count > 0) { IInputEvent e = currentState.Events.Dequeue(); if (e is InputEvent <JoypadKeyEventArgs> keyEvent && keyEvent.Name == "OnButtonPress") { OnButtonPress?.Invoke(this, keyEvent.Info); } if (e is InputEvent <JoypadAxeEventArgs> modEvent && modEvent.Name == "OnAxeMovement") { OnAxeMovement?.Invoke(this, modEvent.Info); } } }
public void PressButton() { InputManager.ClickTime++; DateTime now = DateTime.Now; if (prePressTime != null) { TimeSpan ts = now - (DateTime)prePressTime; if (ts.TotalSeconds < 0.3f || !Platform.IsActive) { return; } } prePressTime = now; if (OnButtonPress != null) { OnButtonPress.Invoke(this, null); } }
public void AddListenerButtonPress(string butonName, OnButtonPress action) { if (dicListenerButtonPress == null) { dicListenerButtonPress = new Dictionary <string, OnButtonPress>(); } if (dicListenerButtonPress.ContainsKey(butonName)) { if (dicListenerButtonPress[butonName] == null) { dicListenerButtonPress[butonName] = action; } dicListenerButtonPress[butonName] += action; } else { dicListenerButtonPress.Add(butonName, action); } }
public virtual void PressButton(GameObject other) { #if UNITY_EDITOR if (verbose) { print("button pressed"); } #endif if (OnButtonPress != null) { OnButtonPress.Invoke(other); } string eventName = gameObject.name; var extra = new Dictionary <string, object>(); extra["parent"] = gameObject.transform.parent.name; if (!eventName.Equals("Body")) { StatisticsTracking.StartEvent("Button Press", eventName, extra); } }
private void Race_KeyDown_1(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up) { if (speedInGame < 21) { speedInGame++; } } if (e.KeyCode == Keys.Down) { if (speedInGame > 0) { speedInGame--; } } OnButtonPress?.Invoke(sender, e); }
public void OnPress() { obp = UIController._instance.hasSelecSever.GetComponent <OnButtonPress>(); obp.severSelect(this.gameObject); obp.isSeverPress = true; }
public virtual void ButtonPress() { OnButtonPress?.Invoke(); }
void OnPress(object sender, EventArgs args) { OnButtonPress?.Invoke(this, args); }
/// <summary> /// Called the player presses a button or in no hands mode drives near the button. /// </summary> public static void ButtonPress(int id) { OnButtonPress?.Invoke(id); }
public void ButtonPressed(string text) { OnButtonPress?.Invoke(text); }
public override void Execute() { OnButtonPress?.Invoke(); }