Click or drag to resize

IsPartDeathListener Interface

Interface to notify about the part's forced destruction.

Namespace:  KSPDev.KSPInterfaces
Assembly:  KSPDev_Utils.2.0 (in KSPDev_Utils.2.0.dll) Version: 2.0 for KSP v1.8+
Syntax
C#
public interface IsPartDeathListener
Request Example View Source

The IsPartDeathListener type exposes the following members.

Methods
  NameDescription
Public methodOnPartDie
Triggers when part ois destroyed by the game's logic.
Top
Remarks
Events of this inteface are triggered by the KSP engine via Unity messaging mechanism. 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.
Examples
public class MyModule : PartModule, IsPartDeathListener {
  /// <inheritdoc/>
  public virtual void OnPartDie() {
    Debug.LogFromat("OnPartDie: {0}", part.name);
  }
}
See Also