Description
The Active
property of the Editor.SceneEditorSession
class provides access to the currently active scene editor session. This property is static, meaning it is shared across all instances of SceneEditorSession
and can be accessed without creating an instance of the class.
Usage
Use the Active
property to retrieve the current active scene editor session. This can be useful when you need to perform operations on the currently active scene, such as saving changes, making it active, or checking its state.
Example
// Access the active scene editor session
Editor.SceneEditorSession activeSession = Editor.SceneEditorSession.Active;
// Check if there is an active session
if (activeSession != null)
{
// Perform operations on the active session
activeSession.Save(false); // Save the session without 'Save As'
activeSession.BringToFront(); // Bring the session to the front
}