UnityEngine.SceneManagement.SceneManager.GetSceneByPath C# (CSharp) Method

GetSceneByPath() public static method

Searches all scenes added to the SceneManager for a scene that has the given asset path.

public static GetSceneByPath ( string scenePath ) : Scene
scenePath string Path of the scene. Should be relative to the project folder. Like: "AssetsMyScenesMyScene.unity".
return Scene
        public static Scene GetSceneByPath(string scenePath)
        {
            Scene scene;
            INTERNAL_CALL_GetSceneByPath(scenePath, out scene);
            return scene;
        }

Usage Example

Beispiel #1
0
 public static Scene GetSceneByPath(string scenePath)
 {
     scenePath = getBuildSettingsScenePath(scenePath);
     return(SceneManager.GetSceneByPath(scenePath));
 }
All Usage Examples Of UnityEngine.SceneManagement.SceneManager::GetSceneByPath