Пример #1
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;
        }
    }
Пример #2
0
 void OnEnable()
 {
     m_replay     = GetComponent <VPReplay>();
     m_controller = GetComponent <VPReplayController>();
 }