private void Update() { if (Input.GetButtonDown("Jump") || Input.GetKeyDown(KeyCode.Space) || Input.GetButtonDown(ButtonType.Y.ToString())) { if (OnActionEvent != null) { OnActionEvent.Invoke(ActionType.Jump); } } if (Input.GetButtonDown("Fire1") || Input.GetButtonDown(ButtonType.R.ToString())) { if (OnActionEvent != null) { OnActionEvent.Invoke(ActionType.Attack); } } if (Input.GetKeyDown(KeyCode.R) || Input.GetButtonDown(ButtonType.A.ToString())) { if (OnActionEvent != null) { OnActionEvent.Invoke(ActionType.Avoid); } } }
private void NextItem() { IsPlaying = true; list[0].action.Invoke(); onNextItem.Invoke(list[0]); }
/// <summary> /// 接受到消息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Consumer_Recevied(object sender, BasicDeliverEventArgs e) { try { //获取消息返回对象 var result = EventMessage.BuildEventMessageResult(e.Body); //触发外部监听事件 _actionMessage?.Invoke(result); if (!result.IsOperationOk) { //未能消费此消息,重新放入队列头 Context.ListenChannel.BasicReject(e.DeliveryTag, true); } else if (!Context.ListenChannel.IsClosed) { Context.ListenChannel.BasicAck(e.DeliveryTag, false); } } catch (Exception exception) { //todo 记录日志 //Console.WriteLine(exception); //throw; } }
void GetChangeOrderInput() { if (Input.GetKeyDown(KeyCode.Q)) { ChangeOrderInput?.Invoke(); } }
public void SendEvent(string name) { MyEventArgs mea = new MyEventArgs(); mea.Info = "work done : " + name; ActionEvent.Invoke(mea); }
void GetJumpInput() { if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.W)) { JumpInput?.Invoke(); } }
void GetResetStageInput() { if (Input.GetKeyDown(KeyCode.Escape)) { ResetStageInput?.Invoke(); } }
public override void Execute() { if (ActionOccurred()) { boundEvent.Invoke(); } }
// ITEM FUNCTIONALITY --------------------------------------------------------------------------------------------- | private void gainItem(typeOfItem item) { switch (item) { case typeOfItem.health: health += 50; if (health > 100) { health = 100; } IGotHit.Invoke(MyTeam, playerNumber, health); break; case typeOfItem.speed: addSpeed(); //IPerformed.Invoke(actions.speed, MyTeam, playerNumber, 0); break; case typeOfItem.power: addPower(); //IPerformed.Invoke(actions.powerUp, MyTeam, playerNumber, 0); break; case typeOfItem.points: IPerformed.Invoke(actions.points, MyTeam, playerNumber, 10); break; } }
void GetActionInput() { if (Input.GetKeyDown(KeyCode.E)) { ActionInput?.Invoke(); } }
private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { _spaceCount++; FloatEvent?.Invoke(_spaceCount); ActionEvent?.Invoke(true, 56); } }
public static void RegisterClickEvent(this Button button, ActionEvent actionEvent, bool handled = false) { button.Click += (object sender, RoutedEventArgs e) => { actionEvent?.Invoke(); if (handled) { e.Handled = true; } }; }
private void OKButton_Click(object sender, RoutedEventArgs e) { ObservableCollection <StaffServiceTimeModel> models = new ObservableCollection <StaffServiceTimeModel>(); foreach (StaffServiceTimeModel model in serviceList.Items) { models.Add(model); } ActionEvent?.Invoke(this, models); this.m_Popup.IsOpen = false; }
public void Withdraw(int sum) { if (Sum >= sum) { Sum -= sum; ActionEvent?.Invoke("вы сняли бабки"); } else { ActionEvent?.Invoke("недостаточно средств"); } }
public void Withdraw(int sum) { if (Sum >= sum) { Sum -= sum; ActionEvent?.Invoke("Вы сняли на своего счета " + sum + ". Остаток " + Sum); } else { ActionEvent?.Invoke("Недостаточно средтсв"); } }
// Down Handler protected override void DownHandler() { if (useDown) { downHandler.Invoke(); } if (broadcast) { downEvent.Invoke(); } }
private void EvaluateButton() { switch (inputState) { case InputState.Pressed: if (InputManager.GetButtonDown(buttonName, playerID)) { onAction.Invoke(); } break; case InputState.Released: if (InputManager.GetButtonUp(buttonName, playerID)) { onAction.Invoke(); } break; case InputState.Held: if (InputManager.GetButton(buttonName, playerID)) { onAction.Invoke(); } break; } }
private void CompleteAction() { Listeners.InvokePerformEvent(currentlyExecutingAction); if (actionQueue.Count > 0) { PerformAction(actionQueue.Dequeue()); } else //we're done here { OnFinishPerform.Invoke(currentlyExecutingAction); } }
void FireEvent() { Interactable i = Interaction(); if (i != null) { InteractEvent?.Invoke(i); } else if (can_input) { DashEvent?.Invoke(); } }
/// <summary> /// Keyタイプの入力処理 /// </summary> /// <param name="key"></param> /// <param name="mappingData"></param> /// <param name="inputEvent"></param> private void HandleActionInput(ActionEventKey key, ActionMapping.MappingData mappingData, ActionEvent inputEvent) { var keyCodeList = mappingData.keyCodeList; var virtualKeyCodeList = mappingData.virtualKeyCodeList; foreach (var code in keyCodeList) { if (getKeyDelegateTable[key.trigger](code)) { inputEvent.Invoke(); return; } } foreach (var code in virtualKeyCodeList) { if (getVirtualKeyDelegateTable[key.trigger](code)) { inputEvent.Invoke(); return; } } }
private void Consumer(object sender, BasicDeliverEventArgs e) { try { var result = MessageFactory.GetMessageResult(e.Body); _action_message?.Invoke(result); //触发外部侦听事件 if (Context.ReceiveChannel.IsClosed == false) { Context.ReceiveChannel.BasicAck(e.DeliveryTag, false); } } catch (Exception ex) { } }
public void PerformAction <T>(T action) where T : GameAction { if (IsExecutingAction()) { actionQueue.Enqueue(action); } else { OnBeginPerform.Invoke(action); currentlyExecutingAction = action; if (Viewers.HasViewers(action)) { StartActionViewers(action); } else { CompleteAction(); } } }
public void testAction(InputMethod inputMethod, float distance, InputHandler handler) { performedAction = performingAction; //Check if the input types are the same bool inputTypeMatches = (inputMethod.Type & type) != InputType.None; //If they are, check if the action is being performed performingAction = inputTypeMatches ? isPerformingAction(inputMethod, distance, handler) : false; if (!performedAction && performingAction) { OnActionStarted.Invoke(inputMethod, distance, handler); } if (performingAction) { OnActionUpdate.Invoke(inputMethod, distance, handler); } if (performedAction && !performingAction) { OnActionEnded.Invoke(inputMethod, distance, handler); } }
void OnSelectHandler() { OnSelect.Invoke(_action); }
public void SendActionEvent(ActionEventArgs e) { ActionEvent?.Invoke(this, e); }
IEnumerator WaitForPlay() { yield return(new WaitForSeconds(timeToWaitAfter)); waitAfter.Invoke(); }
private void OnAction(object sender, SSEActionsEventArgs e) { ActionEvent?.Invoke(this, e); }
public void LoadData() { InitiateEvent?.Invoke(this, new InitiateEventArgs()); ActionEvent?.Invoke(this, new InitiateEventArgs()); }
private void DispatchActionEvent(SSEClientActions action) { ActionEvent?.Invoke(this, new SSEActionsEventArgs(action)); }
private void Web_Action(string obj) { ActionEvent?.Invoke(obj); }