Returns all enabled cameras in the Scene.
All cameras in the scene can be enabled or disabled. The allCameras value tells how many cameras are still enabled. If all the cameras are disabled then a value of zero will be returned.
#pragma strict public class ExampleScript extends MonoBehaviour { private var count: int; function Start() { count = Camera.allCameras.Length; print("We've got " + count + " cameras"); } }
using UnityEngine;
public class ExampleScript : MonoBehaviour { private int count;
void Start() { count = Camera.allCameras.Length; print("We've got " + count + " cameras"); } }