API Reference
Contents
API Reference#
See also
This is the API reference for the BetterEventSystem. If you are looking for a guide, please refer to the starter guide.
Event#
all the following properties and methods are available in the Event.
class.
Constructor#
Name |
Type |
Default |
Description |
---|---|---|---|
name |
|
N/A |
The name of the Event |
allowAsync |
|
|
Whether or not to allow async calls to the listeners |
register |
|
|
Whether or not to register the event in the Event System. |
Methods#
Name |
Return Type |
Parameters |
Description |
---|---|---|---|
AddListener |
|
|
Add a listener to the Event |
RemoveListener |
|
|
Remove a listener from the event |
AddPreprocessor |
|
|
Add a preprocessor to the event |
RemovePreprocessor |
|
|
Remove a preprocessor from the event |
RemoveAllListeners |
|
N/A |
Remove all listeners from the event |
RemoveAllPreprocessors |
|
N/A |
Remove all preprocessor from the event |
RemoveAll |
|
N/A |
Remove all listeners and preprocessor |
Broadcast |
|
|
Broadcast the event to all listeners, passing the data to all inside the |
Properties#
Name |
Type |
Description |
---|---|---|
Name |
|
The name of the event |
AllowAsync |
|
Whether or not to allow async calls to the listeners |
Event System#
The event system is the heart of the BetterEventSystem.
It is a static class that contains all the events and their listeners.
The following properties and methods are available in the EventSystem.
class.
Methods#
Name |
Return Type |
Parameters |
Description |
---|---|---|---|
GetEvent |
|
|
Get an event by name, creating the event if |
Register |
|
|
Register an event |
Properties#
Name |
Type |
Description |
---|---|---|
Events |
|
A list of all the events |
Event Args#
The EventArgs
class allows you to pass data to listeners.
Methods#
Name |
Return Type |
Parameters |
Description |
---|---|---|---|
cancel |
|
|
cancel the execution of the layers. learn more |
Properties#
Name |
Type |
Description |
---|---|---|
data |
|
contains the data sent to the broadcast method, can be modified during middleware |