/// <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());
    }
    /// <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;
    }
Esempio n. 3
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);
    }