Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnSplineCreated or similar
#1
Hi

Is there an event or callback I can use to run a script every time a new spline is created?

Currently I have to manually trigger a loop that iterates over existing splines and configures my wrapper class for each one. 

Thanks!
Reply
#2
Hi
There is no such event for now.
Those spline you want to be aware of, how are they created? API or editor?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(09-06-2023, 08:23 AM)_Aka_ Wrote: Hi
There is no such event for now.
Those spline you want to be aware of, how are they created? API or editor?

Editor. One day, hopefully they will be API through a user focussed runtime GUI but that is far away.

I have a loop constantly checking the total number of splines in the scene which works as a hack for now. 

I also need to be alerted when a connection's number of associated control points changes, which is more annoying to do with an external loop. It was simple enough to add my own c# event to those methods within the connection class, but I prefer to avoid that for obvious future version compatibility reasons.
Reply
#4
Create "empty" prefab that has Your event and instantiate that one whenever user creates Spline and create spline inside "empty" prefab? If I understood the problem correctly?
Reply
#5
(09-06-2023, 02:10 PM)arcadeperfect Wrote:
(09-06-2023, 08:23 AM)_Aka_ Wrote: Hi
There is no such event for now.
Those spline you want to be aware of, how are they created? API or editor?

Editor. One day, hopefully they will be API through a user focussed runtime GUI but that is far away.

I have a loop constantly checking the total number of splines in the scene which works as a hack for now. 

I also need to be alerted when a connection's number of associated control points changes, which is more annoying to do with an external loop. It was simple enough to add my own c# event to those methods within the connection class, but I prefer to avoid that for obvious future version compatibility reasons.

I see. I added your feature request to the backlog. Until this feature is implemented, your workaround seems to be a valid one.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Forum Jump: