GetSceneByPath(string)
Searches all Scenes loaded for a Scene that has the given asset path.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEngine.SceneManagement
- Assembly: UnityEngine.CoreModule
public static Scene GetSceneByPath(string scenePath)
Parameters
Path of the Scene. Should be relative to the project folder. Like: "Assets/MyScenes/MyScene.unity".
Returns
Type | Description |
|---|---|
| Scene | A reference to the Scene, if valid. If not, an invalid Scene is returned. |