Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetSceneByPath(string)

Searches all Scenes loaded for a Scene that has the given asset path.
Read time 1 minuteLast updated 10 days ago

Definition

public static Scene GetSceneByPath(string scenePath)

Parameters

scenePath

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

Returns

Type

Description

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