Documentation

Unity Engine

Unity Engine

levelCount

The total number of levels available (Read Only).
Read time 1 minuteLast updated 2 months ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
Warning
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)); }}