GUICurvesField.cs 662 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using bs;
  3. namespace bs.Editor
  4. {
  5. partial class GUICurvesField
  6. {
  7. /// <summary>
  8. /// Triggered when the curve in the field changes.
  9. /// </summary>
  10. public event Action<AnimationCurve> OnChanged;
  11. /// <summary>
  12. /// Callback triggered when the user clicks on the GUI element.
  13. /// </summary>
  14. partial void Callback_OnClicked()
  15. {
  16. CurveEditorWindow.Show(Curve, (success, curve) =>
  17. {
  18. if (!success)
  19. return;
  20. SetCurve(curve);
  21. OnChanged?.Invoke(curve);
  22. });
  23. }
  24. }
  25. }