コード例 #1
0
 /// <summary>
 /// Called by ReWired when the deflate button is pressed
 /// </summary>
 private void onDeflatePressed(Rewired.InputActionEventData data)
 {
     if (!_playerHasControl)
     {
         return;
     }
     SetState(BalloonState.Deflate);
 }
コード例 #2
0
    /// <summary>
    /// Called by ReWired when the inflate button is released
    /// </summary>
    private void onInflateReleased(Rewired.InputActionEventData data)
    {
        if (!_playerHasControl)
        {
            return;
        }

        SetState(BalloonState.Idle);
    }
コード例 #3
0
    /// <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());
    }
コード例 #4
0
 private void onCancelPressedEvent(Rewired.InputActionEventData data)
 {
     if (isPlayerReady(data.playerId))
     {
         unreadyPlayer(data.playerId);
     }
     else
     {
         UnityEngine.SceneManagement.SceneManager.LoadScene("MainMenu");
     }
 }
コード例 #5
0
 public void onStartPressedEvent(Rewired.InputActionEventData data)
 {
     if (GameManager.Instance.IsPaused) // unpause
     {
         GameManager.Instance.Unpause();
     }
     else // pause
     {
         activate();
     }
 }
コード例 #6
0
 private void onJoinGamePressedEvent(Rewired.InputActionEventData data)
 {
     if (!isPlayerActive(data.playerId))
     {
         activatePlayer(data.playerId);
     }
     else if (!isPlayerReady(data.playerId))
     {
         readyPlayer(data.playerId);
     }
 }
コード例 #7
0
    /// <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;
    }
コード例 #8
0
ファイル: PlayerInput.cs プロジェクト: zrrz/LD46AppleSauce
    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;
        }
    }
コード例 #9
0
    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);
    }
コード例 #10
0
ファイル: BaseInput.cs プロジェクト: zrrz/LD46AppleSauce
 public ButtonAction(Rewired.InputActionEventData data)
 {
     this.data = data;
 }
コード例 #11
0
ファイル: BaseInput.cs プロジェクト: zrrz/LD46AppleSauce
 public AxisAction(Rewired.InputActionEventData data)
 {
     this.data = data;
 }