UnityEngine.SceneManagement.SceneManager.GetSceneByPath C# (CSharp) Méthode

GetSceneByPath() public static méthode

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".
Résultat Scene
        public static Scene GetSceneByPath(string scenePath)
        {
            Scene scene;
            INTERNAL_CALL_GetSceneByPath(scenePath, out scene);
            return scene;
        }

Usage Example

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