Class Scripting
C# scripting service.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public static class Scripting : Object
Properties
MainThreadScheduler
Gets the async tasks scheduler that runs the tasks on a main thread during game update.
Declaration
public static TaskScheduler MainThreadScheduler { get; }
Property Value
System.Threading.Tasks.TaskScheduler
|
Methods
FlushRemovedObjects()
Flushes the removed objects (disposed objects using Object.Destroy).
Declaration
public static extern void FlushRemovedObjects()
HasGameModulesLoaded()
Returns true if game scripts assembly has been loaded.
Declaration
public static bool HasGameModulesLoaded()
Returns
System.Boolean
True if game scripts assembly is loaded, otherwise false. |
InvokeOnUpdate(Action)
Calls the given action on the next scripting update.
Declaration
public static void InvokeOnUpdate(Action action)
Parameters
System.Action
action
The action to invoke. |
IsTypeFromGameScripts(Type)
Returns true if given type is from one of the game scripts assemblies.
Declaration
public static bool IsTypeFromGameScripts(Type type)
Parameters
System.Type
type
|
Returns
System.Boolean
True if the type is from game assembly, otherwise false. |
RunOnUpdate(Action)
Queues the specified work to run on the main thread and returns a System.Threading.Tasks.Task object that represents that work.
Declaration
public static Task RunOnUpdate(Action action)
Parameters
System.Action
action
The work to execute asynchronously |
Returns
System.Threading.Tasks.Task
A task that represents the work queued to execute in the pool. |
Events
Draw
Occurs on scripting draw update. Called during frame rendering and can be used to invoke custom rendering with GPUDevice.
Declaration
public static event Action Draw
Event Type
System.Action
|
Exit
Occurs when scripting engine is disposing. Engine is during closing and some services may be unavailable (eg. loading scenes). This may be called after the engine fatal error event.
Declaration
public static event Action Exit
Event Type
System.Action
|
FixedUpdate
Occurs on scripting fixed update.
Declaration
public static event Action FixedUpdate
Event Type
System.Action
|
LateFixedUpdate
Occurs on scripting late fixed update.
Declaration
public static event Action LateFixedUpdate
Event Type
System.Action
|
LateUpdate
Occurs on scripting late update.
Declaration
public static event Action LateUpdate
Event Type
System.Action
|
Update
Occurs on scripting update.
Declaration
public static event Action Update
Event Type
System.Action
|