protected virtual void OnControllerButtonReleased(InputControlType pButton) { Debug.LogFormat("Controller button {0} was released", pButton); InputAction action = _taskActions.Peek(); if (pButton == action.controlType) { if (action.GetType() == typeof(JoystickAction)) { JoystickAction joystickAction = action as JoystickAction; Debug.Log("Joystick Task Detected - Released"); } else if (action.GetType() == typeof(ButtonAction)) { ButtonAction btnAction = action as ButtonAction; if (btnAction.isHold) { _isHoldTimerActive = false; _holdTime = 0f; _holdTimer = 0f; // Add a check for holdTimer buffer to see if withing range then deque task } } } if (_taskActions.Count == 0) { Messenger.Broadcast(Messages.MINI_GAME_COMPLETE, true); } }
/* PRIVATE FUNCTIONS */ /* EVENT HANDLERS */ protected virtual void OnControllerButtonPressed(InputControlType pButton) { Debug.LogFormat("Controller button {0} was pressed", pButton); InputAction action = _taskActions.Peek(); if (pButton == action.controlType) { if (action.GetType() == typeof(JoystickAction)) { JoystickAction joystickAction = action as JoystickAction; Debug.Log("Joystick Task Detected - Pressed"); } else if (action.GetType() == typeof(ButtonAction)) { ButtonAction btnAction = action as ButtonAction; if (btnAction.isHold) { _isHoldTimerActive = true; _holdTime = btnAction.holdTime; } } } if (_taskActions.Count == 0) { Messenger.Broadcast(Messages.MINI_GAME_COMPLETE, true); } }
public void EnrollJoystick(JoystickAction joystickAction) { if (joystickActions == null) { joystickActions = new List <JoystickAction>(); } joystickActions.Add(joystickAction); }
private bool Next() { if (_actionsToConfigure.Count == 0 || _oppositeActions.Count == 0) return false; CurrentAction = _actionsToConfigure.Dequeue(); CurrentOppositeAction = _oppositeActions.Dequeue(); return true; }
void SetDirection(JoystickAction joystickAction) { // velocity always forced to 1f // input = new Vector2( // joystickAction.direction.x == 0 ? 0 : Mathf.Sign(joystickAction.direction.x), // joystickAction.direction.y == 0 ? 0 : Mathf.Sign(joystickAction.direction.y) // ); // velocity smoothed to joystick distance input = joystickAction.direction; }
private bool Next() { if (_actionsToConfigure.Count == 0 || _oppositeActions.Count == 0) { return(false); } CurrentAction = _actionsToConfigure.Dequeue(); CurrentOppositeAction = _oppositeActions.Dequeue(); return(true); }
void SetButtonCDown(JoystickAction joystickAction) { //Debug.Log("C"); }
void SetButtonBDown(JoystickAction joystickAction) { //Debug.Log("B"); StartCoroutine(Fire()); }
// Buttons Down void SetButtonADown(JoystickAction joystickAction) { //Debug.Log("A"); moving = true; }
protected void OnJoystickAction(JoystickActionEventArgs e) { JoystickAction?.Invoke(this, e); }
void WizardStepCompleted(JoystickAction action, JoystickAction oppositeAction) { Console.WriteLine("Completed step: " + action + " and " + oppositeAction); UpdateLabel(_wizard.CurrentAction); }
public JoystickEvent(JoystickAction action, JoystickDirection direction) { Action = action; Direction = direction; }
private void UpdateLabel(JoystickAction currentAction) { Dispatcher.Invoke(new Action(() => WizardInfo.Content = currentAction)); }
// Buttons Up void SetButtonAUp(JoystickAction joystickAction) { //Debug.Log("A UP"); moving = false; }
void SetButtonCUp(JoystickAction joystickAction) { //Debug.Log("C UP"); }