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
| Member | Description |
|---|---|
| Event.Emit | Publish an immutable record through this component's declared event after committing gameplay state. |
| Event.Subscribe | Subscribe a named synchronous method on this component. Retiring either component or the owning task unregisters the listener. |
| Event.Next | Wait for the next typed payload. Cancellation or retirement unregisters the one-shot listener. |