Click or drag to resize

IsPackable Interface

Interface to track the physics state changes in the part's module.

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 IsPackable
Request Example View Source

The IsPackable type exposes the following members.

Methods
  NameDescription
Public methodOnPartPack
Triggers when physics stops on the part.
Public methodOnPartUnpack
Triggers when physics starts on the part.
Top
Remarks
Events of this inteface are triggered by 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, IsPackable {
  /// <inheritdoc/>
  public void OnPartPack() {
    Debug.Log("OnPartPack");
  }
  /// <inheritdoc/>
  public void OnPartUnpack() {
    Debug.Log("OnPartUnpack);
  }
}
See Also