Interface for modules that need to know if script object is destroyed.
Namespace:
KSPDev.KSPInterfaces
Assembly:
KSPDev_Utils.2.0 (in KSPDev_Utils.2.0.dll) Version: 2.0 for KSP v1.8+
SyntaxThe IsDestroyable type exposes the following members.
Methods
| Name | Description |
---|
 | OnDestroy | Triggers when Unity object is about to destroy. |
Top
Remarks
Events of this inteface are triggered by Unity engine via reflections. It's not required for the
module to implement the interface to be notified but by implementing it the code becomes more
consistent and less error prone.
Examplespublic class MyModule : PartModule, IsDestroyable {
public void OnDestory() {
Debug.LogInfo("OnDestory");
}
}
See Also