using System;
using UnityEngine;
using UnityEngine.Splines;
namespace UnityEditor.Splines
{
///
/// Editor utility functions for working with and .
///
public static class EditorSplineUtility
{
///
/// Invoked once per-frame if a spline property has been modified.
///
public static event Action afterSplineWasModified;
static EditorSplineUtility()
{
Spline.afterSplineWasModified += (spline) =>
{
afterSplineWasModified?.Invoke(spline);
};
}
///
/// Use this function to register a callback that gets invoked
/// once per-frame if any changes occur.
///
/// The callback to register.
///
/// The type parameter of .
///
public static void RegisterSplineDataChanged(Action> action)
{
SplineData.afterSplineDataWasModified += action;
}
///
/// Use this function to unregister change callback.
///
/// The callback to unregister.
///
/// The type parameter of .
///
public static void UnregisterSplineDataChanged(Action> action)
{
SplineData.afterSplineDataWasModified -= action;
}
}
}