Example #1
0
        private void UpdateInput()
        {
            bool rightIsPressed = m_InputReader?.RightIsPressed() ?? false;
            bool leftIsPressed  = m_InputReader?.LeftIsPressed() ?? false;

            if (rightIsPressed && !m_RightWasPressed)
            {
                m_RightIsPressed.Value = true;
            }
            else if (!rightIsPressed && m_RightWasPressed)
            {
                m_RightIsPressed.Value = false;
            }

            if (leftIsPressed && !m_LeftWasPressed)
            {
                m_LeftIsPressed.Value = true;
            }
            else if (!leftIsPressed && m_LeftWasPressed)
            {
                m_LeftIsPressed.Value = false;
            }

            m_RightWasPressed = rightIsPressed;
            m_LeftWasPressed  = leftIsPressed;
        }