Version: 2017.3 (switch to 2017.4)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

SceneManager.GetSceneByPath

public static SceneManagement.Scene GetSceneByPath(string scenePath);

Parameters

scenePath Path of the Scene. Should be relative to the project folder. Like: "Assets/MyScenes/MyScene.unity".

Returns

Scene A reference to the Scene, if valid. If not, an invalid Scene is returned.

Description

Searches all Scenes loaded for a Scene that has the given asset path.

Did you find this page useful? Please give it a rating: