Skip to main content

Class SwitchableCameraConfigurationProvider

Provides camera targets and configuration for pawns that support first and third-person camera views. Configures the appropriate Cinemachine virtual cameras based on the active view mode.

public sealed class SwitchableCameraConfigurationProvider : BaseCameraConfigurationProvider

Inheritance​

Properties​

FirstPersonConfiguration​

The camera effect configuration used when the player is in first-person view, extracted from the assigned VirtualCameraProfile.

[Tooltip("The camera effect settings for first-person view.")]
public DrivingCameraEffectConfig FirstPersonConfiguration { get; }

Property Value​

DrivingCameraEffectConfig

FirstPersonVirtualCam​

The Cinemachine virtual camera instance used to render the first-person view. Typically assigned at runtime by the camera controller.

[Tooltip("The virtual camera used to render the first-person view.")]
public CinemachineVirtualCamera FirstPersonVirtualCam { get; }

Property Value​

CinemachineVirtualCamera

ThirdPersonConfiguration​

The camera effect configuration used when the player is in third-person view, extracted from the assigned VirtualCameraProfile.

[Tooltip("The camera effect settings for third-person view.")]
public DrivingCameraEffectConfig ThirdPersonConfiguration { get; }

Property Value​

DrivingCameraEffectConfig

ThirdPersonVirtualCam​

The Cinemachine virtual camera instance used to render the third-person view. Typically assigned at runtime by the camera controller.

[Tooltip("The virtual camera used to render the third-person view.")]
public CinemachineVirtualCamera ThirdPersonVirtualCam { get; }

Property Value​

CinemachineVirtualCamera

Methods​

IsCameraCompatible(Camera)​

Determines if the given camera is compatible with the camera configuration.

protected override bool IsCameraCompatible(Camera camera)

Parameters​

NameTypeDescription
cameraCameraThe camera to check for compatibility.

Returns​

bool — Returns true if the camera is compatible.

Remarks​

Only cameras that have a SwitchableCameraController attached are considered compatible with this configuration.

OnCameraSet(Camera)​

Callback when a compatible camera is assigned to this pawn. Use this to set up neccessary references or targets to the camera controller.

protected override void OnCameraSet(Camera camera)

Parameters​

NameTypeDescription
cameraCameraThe camera that has been assigned as the main camera to this pawn.
  • Properties
    • FirstPersonConfiguration
    • FirstPersonVirtualCam
    • ThirdPersonConfiguration
    • ThirdPersonVirtualCam
  • Methods
    • IsCameraCompatible(Camera)
    • OnCameraSet(Camera)