Click or drag to resize

PartModuleUtilsInjectEvent Method

Injects an event from one part to another.

Namespace:  KSPDev.PartUtils
Assembly:  KSPDev_Utils.1.1 (in KSPDev_Utils.1.1.dll) Version: 1.1 for KSP v1.6+
Syntax
C#
public static bool InjectEvent(
	PartModule srcModule,
	Action srcEventFn,
	PartModule tgtModule
)
Request Example View Source

Parameters

srcModule
Type: (Default Namespace)PartModule
The module that originally owns the event.
srcEventFn
Type: SystemAction
The event signature in the owner's module.
tgtModule
Type: (Default Namespace)PartModule
The part to inject the event into.

Return Value

Type: Boolean
true if the event has been successfully injected.
Remarks

This method will not add the same event twice. So it's safe to call it multiple times for the same event object.

The name of the event in the target part will be the same as in the original part. It may make troubles in case of the name conflict.

See Also