Skip to content

Event ​

class in OpalScript

A typed component event. Subscribe a handler or await its next payload.

Use an event declared on a component, such as health.damaged. Emit is available only on your own declared events. The owner retires subscriptions when the component or owning task ends.

Methods ​

MemberDescription
Event.EmitPublish an immutable record through this component's declared event after committing gameplay state.
Event.SubscribeSubscribe a named synchronous method on this component. Retiring either component or the owning task unregisters the listener.
Event.NextWait for the next typed payload. Cancellation or retirement unregisters the one-shot listener.

See also ​