Click or drag to resize

IKasJointEventsListener Interface

Interface that notifies listeners about joints breaking.

Namespace:  KASAPIv2
Assembly:  KAS-API-v2 (in KAS-API-v2.dll) Version: KAS API v2
Syntax
C#
public interface IKasJointEventsListener
Request Example View Source

The IKasJointEventsListener type exposes the following members.

Methods
  NameDescription
Public methodOnKASJointBreak
Triggers when a connection on the object is broken due to too strong force applied.
Top
Remarks
This interface must be supported on the "other" side. The object that implements it only declares a desire to know about the joint state. However, when the joint state is actually changed, some other code needs to take care of calling the callback.
Examples
class BrokenJointListenerExample : PartModule, IKasJointEventsListener {
  /// <inheritdoc/>
  public virtual void OnKASJointBreak(GameObject hostObj, float breakForce) {
    if (hostObj.name == "MyFakeRB") {
      DebugEx.Warning("Joint on MyFakeRB is broken with force {0}", breakForce);
      Destroy(hostObj);
    }
  }
}
See Also