Documentation

Unity Engine


Unity Engine


GetBuildIndexByScenePath(string)

Get the build index from a Scene path.
Read time 1 minuteLast updated 9 days ago

Definition

public static int GetBuildIndexByScenePath(string scenePath)

Parameters

scenePath

Scene path (e.g: "Assets/Scenes/Scene1.unity").

Returns

Type

Description

intBuild 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.