Open PeturDarriPeturs opened 3 years ago
+1 👍🏾 @PeturDarriPeturs
I have the same requirement in my project. I would like the similar feature like this another package: xNode/Scene-Graphs
I tought that the script Examples/GraphBehaviour.cs will keep game objects and prefabs references, but the method BaseGraph.LinkToScene(scene)
just automate the scene close when the graph window is closed 😢
@alelievr Could you help us?
Yeah, it's a big limitation of the serialized ScriptableObject in a scene. The problem is that ScriptableObjects are really integrated into the logic of the code so you can't really remove them.
An alternative could be to serialize separately the nodes, parameters, edges, etc. of the graph directly inside the MonoBehaviour and when it's enabled create a graph ScriptableObject and assign the serialized data from the MonoBehaviour. I believe this can work with prefabs.
FYI, I plan to correctly integrate that for the V2 of NGP.
I want to be able to create graphs that are then saved as part of a scene or prefab. With
BaseGraph
inheritingScriptableObject
, that makes it difficult.ScriptableObjects
can be saved as part of a scene, but not as part of a prefab.Maybe
BaseGraph
can be redefined as a serializable class which then is serialized byScriptableObject
andMonoBehaviour
wrappers withSerializeReference
?