Click or drag to resize

AbstractPartModuleRegisterGameEventListenerT Method (EventDataT, EventDataTOnEvent)

Registers a game event listener and cleans it up on module destruction.

Namespace:  KSPDev.PartUtils
Assembly:  KSPDev_Utils.2.5 (in KSPDev_Utils.2.5.dll) Version: 2.5 for KSP v1
Syntax
C#
protected void RegisterGameEventListener<T>(
	EventData<T> eventData,
	EventDataTOnEvent listener
)
Request Example View Source

Parameters

eventData
Type: (Default Namespace)EventDataT
The game event to register for.
listener
Type: (Default Namespace)EventDataTOnEvent
The event listener.

Type Parameters

T
The type of EventData of the related event.
Remarks
Instead of overriding both OnAwake and OnDestroy methods to register/unregister KSP event listeners, do register via this method. The un-registration will be done automatically when the component dies.
See Also