public void SetViewConfig(CarViewConfig viewConfig)
 {
     foreach (CameraMode cam in m_cameraModes)
     {
         cam.SetViewConfig(viewConfig);
     }
 }
    void AdquireTarget()
    {
        // Get the view configuration if exists and configure the camera modes

        if (target != null)
        {
            CarViewConfig viewConfig = target.GetComponent <CarViewConfig>();

            if (viewConfig != null)
            {
                if (viewConfig.lookAtPoint != null)
                {
                    target = viewConfig.lookAtPoint;
                }
                SetViewConfig(viewConfig);
            }
        }

        // Find the rigidbody if exists and get the center of mass

        if (followCenterOfMass && target != null)
        {
            m_targetRigidbody = target.GetComponent <Rigidbody>();
            if (m_targetRigidbody)
            {
                m_localTargetOffset = m_targetRigidbody.centerOfMass;
            }
        }
        else
        {
            m_targetRigidbody = null;
        }

        // Everything ready. Reset the camera for the target.

        ResetCamera();
    }
 public override void SetViewConfig(CarViewConfig viewConfig)
 {
     attachTarget = viewConfig.driverView;
 }
    // Adjust the public values for the given configuration

    public virtual void SetViewConfig(CarViewConfig viewConfig)
    {
    }
 public override void SetViewConfig(CarViewConfig viewConfig)
 {
     targetRadius = viewConfig.targetDiameter;
 }
 public override void SetViewConfig(CarViewConfig viewConfig)
 {
     distance         = viewConfig.viewDistance;
     minDistance      = viewConfig.viewMinDistance;
     minVerticalAngle = viewConfig.viewMinHeight;
 }
 public override void SetViewConfig(CarViewConfig viewConfig)
 {
     distance        = viewConfig.viewDistance;
     height          = viewConfig.viewHeight;
     rotationDamping = viewConfig.viewDamping;
 }