Class CameraChanger
Switches between the camera objects that are children to this object and contain camera tag, in order they appear in the hierarchy or in order they are added to the vehicle cameras list.
Namespace: NWH.Common.Cameras
Assembly: NWH.Common.dll
Syntax
[DefaultExecutionOrder(20)]
public class CameraChanger : MonoBehaviour
Fields
| Edit this page View SourceautoFindCameras
If true vehicleCameras list will be filled through cameraTag.
Declaration
[Tooltip(" If true vehicleCameras list will be filled through cameraTag.")]
public bool autoFindCameras
Field Value
| Type | Description |
|---|---|
| bool |
cameras
List of cameras that the changer will cycle through. Leave empty if you want cameras to be automatically detected. To be detected cameras need to have camera tag and be children of the object this script is attached to.
Declaration
[FormerlySerializedAs("vehicleCameras")]
[Tooltip("List of cameras that the changer will cycle through. Leave empty if you want cameras to be automatically detected. To be detected cameras need to have camera tag and be children of the object this script is attached to.")]
public List<GameObject> cameras
Field Value
| Type | Description |
|---|---|
| List<GameObject> |
currentCameraIndex
Index of the camera from vehicle cameras list that will be active first.
Declaration
[Tooltip(" Index of the camera from vehicle cameras list that will be active first.")]
public int currentCameraIndex
Field Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceNextCamera()
Activates the next camera in the list, cycling back to the first camera when reaching the end. Automatically disables all other cameras and their AudioListeners.
Declaration
public void NextCamera()
PreviousCamera()
Activates the previous camera in the list, cycling back to the last camera when reaching the beginning. Automatically disables all other cameras and their AudioListeners.
Declaration
public void PreviousCamera()