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
  Disable rebuild of meshes in dynamic mode Zilk1 2 9 2 hours ago
Last Post: Zilk1
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 12 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_

Forum Jump: