コード例 #1
0
        // Component methods


        void OnEnable()
        {
            if (vehicle != null)
            {
                m_input    = vehicle.GetComponent <VPStandardInput>();
                m_settings = vehicle.GetComponent <VPSettingsSwitcher>();
            }
            else
            {
                m_input    = null;
                m_settings = null;
            }

            if (drivingAidsPanel != null)
            {
                drivingAidsPanel.ConfigureDefaults();
                drivingAidsPanel.gameObject.SetActive(false);
            }

            // Switching steering mode when no gyro is available is not handled properly.
            // It may take a bit to the filter to catch up with the current acceleration.
            //
            // TO-DO: This should be deprecated and use a n-averaged value instead.

            m_acceleration = Input.acceleration;

            // Fallback to regular touch mode if no accelerometer nor gyro are present

            if (!SystemInfo.supportsAccelerometer && !SystemInfo.supportsGyroscope)
            {
                steeringMode = SteeringMode.Touch;
            }
        }
コード例 #2
0
        public void ManettinoDialChanged(int position)
        {
                #if !VPP_LIMITED
            if (vehicle != null)
            {
                VPSettingsSwitcher settings = vehicle.GetComponent <VPSettingsSwitcher>();

                if (settings != null)
                {
                    settings.selectedGroup = position;
                    settings.Refresh();
                }
            }
                #endif
        }