# levelCount

> The total number of levels available (Read Only).

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

> **Warning:**
>
> **Deprecated.** Use SceneManager.sceneCountInBuildSettings

```csharp
public static int levelCount { get; }
```

### Examples

```csharp
using UnityEngine;

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