A type used to generate GameEvents More...
Public Member Functions | |
EventVoid (string eventName) | |
The constructor used to create a new EventVoid More... | |
void | Add (EventVoid.OnEvent evt) |
Add a method to be run when the EventVoid is fired. More... | |
void | Fire () |
Triggers the EventVoid More... | |
void | Remove (EventVoid.OnEvent evt) |
Remove a method from the list of methods to be run when the EventVoid is fired. More... | |
delegate void | OnEvent () |
Any methods added to the event must match the delegate's parameters; none in this case More... | |
Static Public Member Functions | |
static bool | AddEventScene (string eventName, EventVoid.OnEvent evt, bool addToAll) |
static bool | AddEventUpwards (Transform transform, string eventName, EventVoid.OnEvent evt, bool addToAll) |
static EventVoid | FindEventScene (string eventName) |
static List< EventVoid > | FindEventsScene (string eventName) |
static List< EventVoid > | FindEventsUpwards (Transform transform, string eventName) |
static EventVoid | FindEventUpwards (Transform transform, string eventName) |
static bool | RemoveEventScene (string eventName, EventVoid.OnEvent evt, bool removeFromAll) |
static bool | RemoveEventUpwards (Transform transform, string eventName, EventVoid.OnEvent evt, bool removeFromAll) |
Public Attributes | |
bool | debugEvent |
Generate debug logs if true More... | |
A type used to generate GameEvents
Use this type when there is no need to accompany the event with any parameters, ie relevant Part, Vessel, CelestialBody, etc...
See EventData for events that require such extra information
EventVoid.EventVoid | ( | string | eventName | ) |
void EventVoid.Add | ( | EventVoid.OnEvent | evt | ) |
Add a method to be run when the EventVoid is fired.
This is generally done in an object's Start or Awake method, or a class' constructor.
Can be setup like:
GameEvents.someEventVoidEvent.Add(yourMethod);
or
GameEvents.someEventVoidEvent.Add(new EventVoid.OnEvent(yourMethod));
evt | The method you want to add, should contain no parameters |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void EventVoid.Fire | ( | ) |
Triggers the EventVoid
All of the methods added using Add are run after this.
delegate void EventVoid.OnEvent | ( | ) |
Any methods added to the event must match the delegate's parameters; none in this case
void EventVoid.Remove | ( | EventVoid.OnEvent | evt | ) |
Remove a method from the list of methods to be run when the EventVoid is fired.
This is generally done in an object's OnDestroy method.
evt | The method you want to remove, should contain no parameters |
|
static |
|
static |
bool EventVoid.debugEvent |
Generate debug logs if true