Method group is Obsolete

Application.levelCount

Obsolete Use SceneManager.sceneCountInBuildSettings. public static int levelCount;

Description

The total number of levels available (Read Only).

using UnityEngine;

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

Did you find this page useful? Please give it a rating: