Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with working with multiple scenes
#1
Question 
Hi there,

we are using Curvy Splines as our tool to move a creature down a path (logic like a train with junctions).

Our world will be quite large so we have splitted our world into multiple smaller subscenes for performance and workflow reasons.

Almost every scene will contain one or more splines that have junctions (connections). We do not cross refernce splines from one scene to another. But here comes the problem:
The _CurvyGlobal_ Manager removes itself from scenes and merges into one. This is a problem as the connections will have other scripts attached to it with more logic and information.

The only solution would be to have the Global Manager in the Main Scene, but Unity does not support cross referencing between scenes, so everytime we try to save subscenes in the Editor the splines would break, if we opened more than one scene containing splines and connections.

Is there a way to work around that without coding custom connections? I would love a way to have multiple global managers, so that every scene works in itself without breaking others.

Can you help me?

Regards,

Kasimir
Reply
#2
Hi
Would modifying CurvyGlobalManager.MergeDoubleLoaded(...) work? You could modify it to copy whatever data you need from the duplicated singleton into the new one.
I hope this helped. If not, maybe I can be more helpful with more details about your use case.
Have a nice day
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
I have currently worked around it by adjusting the DTSingleton to have an instance per scene: Instance(Scene scene)
It don't normally want to modify plugins, but this seemed the most easy way to solve this. So now all splines, nodes or connections will always get the correct instance.

The problem is not when playing the game, there it's probably not important when the connections move. The problem is that we have a multi scene setup and we actually work with many scenes open at the same time (kind of an open world) When we hit save, then we would have had cross references as the Connections would have been moved into another scene. I am trying to avoid having to open the scenes without other scenes to be able to work on it.

Do you know what I should check that the plugin works as intendet? Like editor script that use the instance that are scene independant for example (This is a heart surgery after all Big Grin )

Regards Kasimir
Reply
#4
Your solution is not a bad one, but you need to be aware of what it implies:
If you see how the CurvyGlobalManager is used in the code, you will see that it is mainly for 3 things: connections, pools and editor settings (such as what gizmos to display).
By having one CurvyGlobalManager instance for each scene, I suspect that:
  • you will solve your connections problem
  • have duplicated pools, which will reduce the efficacy of the optimizations brought by the usage of pools. This might not be a big deal for you
  • have duplicated fields storing editor settings, which might create discrepancies between the actual editor setting and the one stored in CurvyGlobalMange. This might not be a big deal if you don't change the editor settings much
Please let me know how your idea of having an instance per scene will go
Thanks and have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
Currently it's surprisingly stable Smile

If I come across any problems I'll post it here for future reference Smile

Thanks for the plugin btw, it solved many other major hurdles that other plugins couldn't do Smile
Reply
#6
Glad to read that.
If and when you feel like it, please leave a review for the asset, that helps a lot.
By the way, out of curiosity, what are the features that solved your other problems that were missing in the other plugins you tried?
Have a nice day
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
  Connections Problem Juton 3 16 03-06-2024, 10:41 AM
Last Post: _Aka_
Bug Issues when working with in-place prefabs Sacryn 4 6 02-27-2024, 04:08 PM
Last Post: _Aka_
  Distance travelled across multiple splines jh092 1 7 02-23-2024, 09:44 AM
Last Post: _Aka_
  Multiple Splines and Generators Performantly for Road System drock 1 6 07-17-2023, 10:31 AM
Last Post: _Aka_

Forum Jump: