文档

Unity Engine

Unity Engine

allCamerasCount

The number of cameras in the current Scene.
阅读时间1 分钟最后更新于 2 天前

Definition

public static int allCamerasCount { get; }

Remarks

Returns the size of the array that Camera.allCameras returns and the amount of cameras that Camera.GetAllCameras will fill.

Examples

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