/// <summary> /// Called by ReWired when the deflate button is pressed /// </summary> private void onDeflatePressed(Rewired.InputActionEventData data) { if (!_playerHasControl) { return; } SetState(BalloonState.Deflate); }
/// <summary> /// Called by ReWired when the inflate button is released /// </summary> private void onInflateReleased(Rewired.InputActionEventData data) { if (!_playerHasControl) { return; } SetState(BalloonState.Idle); }
/// <summary> /// Called by ReWired when right trigger axis data is updated /// </summary> private void onRightTriggerUpdate(Rewired.InputActionEventData data) { if (!_playerHasControl) { return; } setPropForce(RightProp, data.GetAxis()); }
private void onCancelPressedEvent(Rewired.InputActionEventData data) { if (isPlayerReady(data.playerId)) { unreadyPlayer(data.playerId); } else { UnityEngine.SceneManagement.SceneManager.LoadScene("MainMenu"); } }
public void onStartPressedEvent(Rewired.InputActionEventData data) { if (GameManager.Instance.IsPaused) // unpause { GameManager.Instance.Unpause(); } else // pause { activate(); } }
private void onJoinGamePressedEvent(Rewired.InputActionEventData data) { if (!isPlayerActive(data.playerId)) { activatePlayer(data.playerId); } else if (!isPlayerReady(data.playerId)) { readyPlayer(data.playerId); } }
/// <summary> /// Set the emmision.rateOverTimeMultiplier of the right engine based on the axis /// of the rewired input data /// </summary> /// <param name="data">Rewired input data</param> private void setRightEngineEmmision(Rewired.InputActionEventData data) { // Set the right engine emmission if (RightEngine == null) { return; } float value = _startingEmmision + data.GetAxis() * FlameScale;; _rightEmmisionModule.rateOverTimeMultiplier = value; }
void OnInputUpdate(Rewired.InputActionEventData data) { switch (data.actionId) { case RewiredConsts.Action.MoveHorizontal: moveHorizontal = new AxisAction(data); break; case RewiredConsts.Action.MoveVertical: moveVertical = new AxisAction(data); break; case RewiredConsts.Action.LookHorizontal: lookHorizontal = new AxisAction(data); break; case RewiredConsts.Action.LookVertical: lookVertical = new AxisAction(data); break; case RewiredConsts.Action.Sprint: sprint = new ButtonAction(data); break; case RewiredConsts.Action.Interact: interact = new ButtonAction(data); break; case RewiredConsts.Action.Jump: jump = new ButtonAction(data); break; default: break; } }
public bool HandleInput(Rewired.InputActionEventData data) { bool handled = false; switch (data.actionId) { //case RewiredConsts.Action.Navigate_Horizontal: // float value = data.GetAxis(); // if (value != 0f && m_MenuItems[m_ActiveIndex].m_Togglable) // { // // will need to figure out how to cut out of this. will likely need to change the switch to an if/else // // audio // VSEventManager.Instance.TriggerEvent(new AudioEvents.RequestUIAudioEvent(true, AudioManager.eUIClip.Navigate)); // } // break; case RewiredConsts.Action.Navigate_Vertical: float value = data.GetAxis(); if (value != 0f && m_CurrentTime <= 0f) { if (value < 0f) { m_ActiveIndex = (m_ActiveIndex + 1) % m_MenuLabels.Length; } else if (value > 0f) { if (m_ActiveIndex - 1 < 0) { m_ActiveIndex = m_MenuLabels.Length; } m_ActiveIndex -= 1; } SetActiveItem(m_ListItems[m_ActiveIndex]); m_CurrentTime = m_ScrollDelay; // audio //VSEventManager.Instance.TriggerEvent(new AudioEvents.RequestUIAudioEvent(true, AudioManager.eUIClip.Navigate)); handled = true; } m_CurrentTime -= Time.deltaTime; break; case RewiredConsts.Action.Confirm: if (data.GetButtonDown()) { OnItemSelected(m_ActiveIndex); // audio //VSEventManager.Instance.TriggerEvent(new AudioEvents.RequestUIAudioEvent(true, AudioManager.eUIClip.Confirm)); handled = true; } break; } return(handled); }
public ButtonAction(Rewired.InputActionEventData data) { this.data = data; }
public AxisAction(Rewired.InputActionEventData data) { this.data = data; }