Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
feature: Add OnJointBreakAsObservable() trigger.
Browse files Browse the repository at this point in the history
The real implementation was already there. I only added the extension
method to make it easier to access.
  • Loading branch information
shanecelis committed Apr 13, 2022
1 parent 1881557 commit af657ab
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -457,5 +457,11 @@ public static IObservable<Unit> OnParticleTriggerAsObservable(this Component com
#endif

#endregion

public static IObservable<float> OnJointBreakAsObservable(this Joint joint)
{
if (joint == null || joint.gameObject == null) return Observable.Empty<float>();
return GetOrAddComponent<ObservableJointTrigger>(joint.gameObject).OnJointBreakAsObservable();
}
}
}
}

0 comments on commit af657ab

Please sign in to comment.