public override void Initialize()
        {
            dataLogger.topLimit    = 12.0f;
            dataLogger.bottomLimit = -0.5f;

            m_deviceInput = vehicle.GetComponentInChildren <VPDeviceInput>();
        }
Esempio n. 2
0
        public override void OnEnableVehicle()
        {
            m_vehicle = vehicle.GetComponent <VPVehicleController>();
            if (m_vehicle == null)
            {
                DebugLogWarning("This component requires a VPVehicleController-based vehicle. Component disabled");
                enabled = false;
                return;
            }

            m_deviceInput = vehicle.GetComponentInChildren <VPDeviceInput>();
        }
Esempio n. 3
0
    void OnEnable()
    {
        rigidBody424     = GetComponent <Rigidbody>();
        vehicleBase      = GetComponent <VehicleBase>();
        target           = GetComponentInChildren <VPReplay>();
        replayController = GetComponentInChildren <VPReplayController>();

        // Disable autopilot when no replay data is available
        if (replayController == null || replayController.predefinedReplay == null)
        {
            enabled = false;
            return;
        }

        recordedReplay = replayController.predefinedReplay.recordedData;
        cuts           = recordedReplay.Count / 500;

        m_deviceInput = vehicleBase.GetComponentInChildren <VPDeviceInput>();
        if (m_deviceInput != null)
        {
            m_ffbForceIntensity    = m_deviceInput.forceIntensity;
            m_ffbDamperCoefficient = m_deviceInput.damperCoefficient;
        }
    }