Camera.allCameras Manual     Reference     Scripting  
Scripting > Runtime Classes > Camera
Camera.allCameras

static var allCameras : Camera[]

Description

Returns all enabled cameras in the scene.

JavaScripts
var count : int = Camera.allCameras.Length;
print ("We've got " + count + " cameras");

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
public int count = Camera.allCameras.Length;
void Awake() {
print("We've got " + count + " cameras");
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

public count as int = Camera.allCameras.Length

def Awake():
print((('We\'ve got ' + count) + ' cameras'))