Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


allCameras

Returns all enabled cameras in the Scene.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static Camera[] allCameras { get; }

Remarks

All cameras in the scene can be enabled or disabled. The Camera.allCameras value tells how many cameras are still enabled. If all the cameras are disabled then a value of zero will be returned.

Examples

using UnityEngine;public class ExampleScript : MonoBehaviour{ private int count; void Start() { count = Camera.allCameras.Length; print("We've got " + count + " cameras"); }}