Lithium.Core.Event
Provides named calls and events between addons. Instance handlers are limited to components in the target scene. Static handlers are discovered through Sandbox.Internal.TypeLibrary.
This page is generated from the public C# symbols in src/game/sandbox/Code.
Event
Status: Experimental
Signature
public static class EventDescription
Provides named calls and events between addons. Instance handlers are limited to components in the target scene. Static handlers are discovered through Sandbox.Internal.TypeLibrary.
Example
var result = Event.Call<ExampleType>("name", args);Members
Call (overload 1 of 2)
Status: Experimental
Signature
public static T? Call<T>(string name, params object[] args)Description
Calls the first matching endpoint in the active scene and casts its result to T.
Example
var result = Event.Call<ExampleType>("name", args);Call (overload 2 of 2)
Status: Experimental
Signature
public static T? Call<T>(Scene scene, string name, params object[] args)Description
Calls the first matching endpoint in scene and casts its result to T.
Example
var result = Event.Call<ExampleType>(scene, "name", args);TryCall (overload 1 of 2)
Status: Experimental
Signature
public static bool TryCall(string name, out object? result, params object[] args)Description
Attempts to call the first matching endpoint in the active scene.
Example
var succeeded = Event.TryCall("name", out var result, args);TryCall (overload 2 of 2)
Status: Experimental
Signature
public static bool TryCall(Scene scene, string name, out object? result, params object[] args)Description
Attempts to call the first matching endpoint in scene. Component endpoints are considered before static endpoints.
Example
var succeeded = Event.TryCall(scene, "name", out var result, args);Emit (overload 1 of 2)
Status: Experimental
Signature
public static int Emit(string name, params object[] args)Description
Emits an event to every matching listener in the active scene. Returns the number of listeners that completed successfully.
Example
var result = Event.Emit("name", args);Emit (overload 2 of 2)
Status: Experimental
Signature
public static int Emit(Scene scene, string name, params object[] args)Description
Emits an event to every matching listener in scene. Returns the number of listeners that completed successfully.
Example
var result = Event.Emit(scene, "name", args);