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 a scene and running a game within the editor environment.
Example
// Example of using the IsGameSession property
Editor.SceneEditorSession session = Editor.SceneEditorSession.Active;
if (session.IsGameSession)
{
// Perform actions specific to a game session
Console.WriteLine("This is a game session.");
}
else
{
// Perform actions specific to a non-game session
Console.WriteLine("This is not a game session.");
}