GetBuildIndexByScenePath(string)
Get the build index from a Scene path.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEngine.SceneManagement
- Assembly: UnityEngine.CoreModule
public static int GetBuildIndexByScenePath(string scenePath)
Parameters
Scene path (e.g: "Assets/Scenes/Scene1.unity").
Returns
Type | Description |
|---|---|
| int | Build index. |
Remarks
The build index refers to the index into the list of Scenes as specified in the Build Settings window.
If the scene isn't found it returns -1.