Class Engine
The main engine class.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public static class Engine : Object
Properties
CommandLine
Gets the application command line arguments.
Declaration
[Unmanaged]
public static string CommandLine { get; }
Property Value
System.String
|
FrameCount
Gets the current frame (drawing) count since the start of the game.
Declaration
[Unmanaged]
public static ulong FrameCount { get; }
Property Value
System.UInt64
|
FramesPerSecond
Gets the amount of frames rendered during last second known as Frames Per Second. User scripts updates or fixed updates for physics may run at a different frequency than scene rendering. Use this property to get an accurate amount of frames rendered during the last second.
Declaration
[Unmanaged]
public static int FramesPerSecond { get; }
Property Value
System.Int32
|
HasFocus
True if app has focus (one of the windows is being focused).
Declaration
[Unmanaged]
public static bool HasFocus { get; }
Property Value
System.Boolean
|
HasGameViewportFocus
Checks whenever the game viewport is focused by the user (eg. can receive input).
Declaration
[Unmanaged]
public static bool HasGameViewportFocus { get; }
Property Value
System.Boolean
|
IsEditor
Returns true if the game is running in the Flax Editor; false if run from any deployment target. Use this property to perform Editor-related actions.
Declaration
[Unmanaged]
public static bool IsEditor { get; }
Property Value
System.Boolean
|
IsHeadless
Returns true if engine is running without main window (aka headless mode).
Declaration
[Unmanaged]
public static bool IsHeadless { get; }
Property Value
System.Boolean
|
StartupTime
The engine start time (local time).
Declaration
[Unmanaged]
public static DateTime StartupTime { get; }
Property Value
System.DateTime
|
UpdateCount
Gets the current update counter since the start of the game.
Declaration
[Unmanaged]
public static ulong UpdateCount { get; }
Property Value
System.UInt64
|
UpdateGraph
Task graph for engine update.
Declaration
[Unmanaged]
public static TaskGraph UpdateGraph { get; }
Property Value
TaskGraph
|
Methods
FocusGameViewport()
Brings focused to the game viewport (game can receive input).
Declaration
[Unmanaged]
public static void FocusGameViewport()
GetCustomSettings(String)
Gets the custom game settings asset referenced by the given key.
Declaration
[Unmanaged]
public static JsonAsset GetCustomSettings(string key)
Parameters
System.String
key
The settings key. |
Returns
JsonAsset
The returned asset. Returns null if key is invalid, cannot load asset or data is missing. |
RequestExit(Int32)
Requests normal engine exit.
Declaration
[Unmanaged]
public static void RequestExit(int exitCode = 0)
Parameters
System.Int32
exitCode
The exit code. |
Events
RequestingExit
Event called when the engine is requesting exit.
Declaration
[Unmanaged]
public static event Action RequestingExit
Event Type
System.Action
|