Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curvy Generator re-initializes on disable?
#1
I found that the curvy generator seems to reset and redo its initialization OnDisable / OnEnable.

This is an issue because even if I were to deactivate my spline object, I don't want the pooled instantiated prefabs to be rebuilt. Is there a way or option around this?

Edit* I also found that if the control points are less then 2, it seems to rebuild all the prefabs.

Is there a way to have all built pooled prefabs be kept initialized regardless of if the spline was enabled/disabled or the points are below 2?


Edit** I see that the CreateGameObject module deletes any pools not used. It'd be nice if this could be modified to be toggled off
Reply
#2
Hi
If you need to keep the generated objects while the generator is disabled, then you should probably use the SaveToScene method:

https://api.curvyeditor.com/FluffyUnderw...Transform_

It's the API method equivalent to the button on the toolbar saving resources to scene
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#3
Check the other post first, I attached some example that i believe will be helfpful.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#4
(05-18-2023, 05:04 PM)_Aka_ Wrote: If you need to keep the generated objects while the generator is disabled, then you should probably use the SaveToScene method:

Isn't this a more expensive method meant to be called just once? I need to make sure that any of the assets I generate are saved when I place the spline. However If I were to move/edit the existing spline, I'd still like to update and re-generate while having all the prefabs already setup.

This is because this level editor isn't meant to save the level, its a tower defense game and the components of the spline just needs to be allowed to initialize and function.
Reply
#5
(05-19-2023, 01:19 PM)Lupos Wrote: Isn't this a more expensive method meant to be called just once?
It should not be more expensive than updating the generator to create the same objects.

(05-19-2023, 01:19 PM)Lupos Wrote: I'd still like to update and re-generate while having all the prefabs already setup.
I believe this answers it: https://forum.curvyeditor.com/thread-174...ml#pid5820
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 7 4,418 07-13-2025, 07:11 PM
Last Post: _Aka_
  NullReferenceException when enable and disable curves with followups phaix 6 2,364 05-15-2025, 07:55 AM
Last Post: phaix
  How to rotate generator asteroids patndan74 6 2,762 05-08-2025, 10:07 PM
Last Post: _Aka_
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 1,308 02-03-2025, 09:34 AM
Last Post: _Aka_

Forum Jump: