Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question (Splines package) How do I detect spline changes made in the inspector?

Discussion in '2022.1 Beta' started by MCrafterzz, Dec 18, 2021.

  1. MCrafterzz

    MCrafterzz

    Joined:
    Jun 3, 2017
    Posts:
    354
    I'm currently experimenting with the new spline package (Splines | Splines | 1.0.0-pre.7 (unity3d.com)) and I want to detect its changes to be able to regenerate a mesh based on the spline data. There is a Spline.changed Unity Event when the spline is changed in the world (adding new points, moving points etc) but it is not called for changes made in the inspector. So what is the preferred way of detecting this? I need to detect changing the spline points in the inspector as well as enabling/disabling the closed property. Maybe it's possible to display the SplineContainer properties in the custom editor for my own script so that I can detect it with EditorGui.BeginChangeCheck, but that feels super hacky. Any ideas?
     
  2. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
  3. MCrafterzz

    MCrafterzz

    Joined:
    Jun 3, 2017
    Posts:
    354