using System;
namespace Unity.VisualScripting
{
///
/// Called when a joint attached to the same game object broke.
///
[UnitCategory("Events/Physics")]
public sealed class OnJointBreak : GameObjectEventUnit
{
public override Type MessageListenerType => typeof(UnityOnJointBreakMessageListener);
protected override string hookName => EventHooks.OnJointBreak;
///
/// The force that was applied for this joint to break.
///
[DoNotSerialize]
public ValueOutput breakForce { get; private set; }
protected override void Definition()
{
base.Definition();
breakForce = ValueOutput(nameof(breakForce));
}
protected override void AssignArguments(Flow flow, float breakForce)
{
flow.SetValue(this.breakForce, breakForce);
}
}
}