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
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 4 Yesterday, 07:25 AM
Last Post: amutp
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 0 3 Yesterday, 03:23 AM
Last Post: _Aka_
  Generating GO only on CPs in Generator GameDeveloperek4123 1 6 03-04-2024, 11:06 AM
Last Post: _Aka_
  Using Unity's SplineContainer in Curvy Splines dlees9191 3 14 02-26-2024, 09:49 AM
Last Post: _Aka_

Forum Jump: