文档

Unity Engine

Download Unity

Unity Engine

GetBuildIndexByScenePath(string)

Get the build index from a Scene path.
阅读时间1 分钟最后更新于 2 个月前

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.