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/FluffyUnderware.Curvy.Generator.Modules.ResourceExportingModule.html#FluffyUnderware_Curvy_Generator_Modules_ResourceExportingModule_SaveToScene_UnityEngine_Transform_

It's the API method equivalent to the button on the toolbar saving resources to scene
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
Check the other post first, I attached some example that i believe will be helfpful.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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-1742-post-5820.html#pid5820
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy discards Input Spline Range VoltDriver 3 3 11-28-2023, 07:14 PM
Last Post: _Aka_
  Problematic Curvy API XtroTheArctic 8 23 10-16-2023, 08:41 AM
Last Post: _Aka_
  Disable rebuild of meshes in dynamic mode Zilk1 1 3 10-04-2023, 09:50 AM
Last Post: _Aka_
  Curvy Splines Built In Editor Undo causes issues. Lupos 1 7 10-02-2023, 08:52 AM
Last Post: _Aka_

Forum Jump: