bool IsGameSession { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The IsGameSession property of the SceneEditorSession class indicates whether the current session is a running game session. It returns a boolean value, where true signifies that the session is indeed a game session, and false indicates otherwise.

Usage

Use the IsGameSession property to determine if the current SceneEditorSession is being used to run a game. This can be particularly useful when you need to differentiate between editing sessions and game sessions, allowing you to conditionally execute code based on the session type.

Example

// Example of using IsGameSession property

Editor.SceneEditorSession session = Editor.SceneEditorSession.Active;

if (session.IsGameSession)
{
    // Code to execute if the session is a game session
    // For example, disable certain editor features
}
else
{
    // Code to execute if the session is not a game session
    // For example, enable editing tools
}