private void FixedUpdate()
        {
            // Read input for the pitch, yaw, roll and throttle of the aeroplane.
            float roll  = Input.GetAxis("Mouse X");
            float pitch = Input.GetAxis("Mouse Y");

            m_AirBrakes = Input.GetButton("Fire1");
            m_Yaw       = Input.GetAxis("Horizontal");
            m_Throttle  = Input.GetAxis("Vertical");
#if MOBILE_INPUT
            AdjustInputForMobileControls(ref roll, ref pitch, ref m_Throttle);
#endif
            // Pass the input to the aeroplane
            m_Aeroplane.Move(roll, pitch, m_Yaw, m_Throttle, m_AirBrakes);
        }
コード例 #2
0
        private void FixedUpdate()
        {
            // Read input for the pitch, yaw, roll and throttle of the aeroplane.
            float roll      = Input.GetAxis("Horizontal");
            float pitch     = Input.GetAxis("Vertical");
            bool  airBrakes = Input.GetButton("Fire1");

            // auto throttle up, or down if braking.
            float throttle = airBrakes ? -1 : 1;

#if MOBILE_INPUT
            AdjustInputForMobileControls(ref roll, ref pitch, ref throttle);
#endif
            // Pass the input to the aeroplane
            m_Aeroplane.Move(roll, pitch, 0, throttle, airBrakes);
        }