GetSceneByPath(string)
Searches all Scenes loaded for a Scene that has the given asset path.
Read time 1 minuteLast updated 10 days ago
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. |