文档

Unity Engine

Unity Engine

levelCount

The total number of levels available (Read Only).
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
警告
Deprecated. Use SceneManager.sceneCountInBuildSettings
public static int levelCount { get; }

Examples

using UnityEngine;class Example : MonoBehaviour{ void Start() { //Loads a random level Application.LoadLevel(Random.Range(0, Application.levelCount - 1)); }}