| PartModuleUtils Class | 
 Inheritance Hierarchy
Inheritance HierarchyNamespace: KSPDev.PartUtils
 Syntax
SyntaxThe PartModuleUtils type exposes the following members.
 Methods
Methods| Name | Description | |
|---|---|---|
|   | AddEvent | Add an event into a part module. | 
|   | DropEvent | Removes the specified event from the part module. | 
|   | GetAction | Returns an action for the requested method. | 
|    | GetEvent | Returns an event for the requested method. | 
|   | InjectEvent | Injects an event from one part to another. | 
|   | InvalidateContextMenu | Forces the context menu of the part to refresh itself. | 
|   | SetupAction | Applies a setup function on a KSP part module action. | 
|    | SetupEvent | Applies a setup function on a KSP part module event. | 
|   | WithdrawEvent | Removes an event that was previously injected. | 
 Examples
Examplesclass PartModuleUtils_SetupEvent : PartModule { [KSPEvent(guiName = "test", guiActive = true, active = false)] void TestEvent() { Debug.Log("Test event triggered"); } void SetupEvents() { // This call will activate the event. PartModuleUtils.SetupEvent(this, TestEvent, x => x.active = true); } }
 Examples
Examplesclass PartModuleUtils_GetEvent : PartModule { [KSPEvent(guiName = "test", guiActive = true, active = false)] void TestEvent() { Debug.Log("Test event triggered"); } void SetupEvents() { var e = PartModuleUtils.GetEvent(this, TestEvent); e.active = true; // Activates the event. } }
 See Also
See Also