SceneUtility.GetBuildIndexByScenePath

Switch to Manual
public static int GetBuildIndexByScenePath (string scenePath);

Parameters

scenePath场景路径(例如:“Assets/Scenes/Scene1.unity”)。

Returns

int 构建索引。

Description

Get the build index from a Scene path.

The build index refers to the index into the list of Scenes as specified in the Build Settings window.