Version: 2017.3

Camera.allCameras

切换到手册
public static Camera[] allCameras ;

描述

返回场景中所有已启用的摄像机。

using UnityEngine;
using System.Collections;

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