Open TheBricktop opened 4 years ago
xNode is not a visual scripting framework. Generating procedural code from graphs is possible, but completely outside the scope of xNode.
While prefabs cannot contain graphs due to engine limitations, a prefab can reference any other graph asset. On prefab instantiation you can call graph.Copy(), and you'll have a fresh graph copy to work with for your prefab.
Thanks for answering my question, so for example if I'm going to make a graph that controls transform position of the gameobject I have to create scene graph and a script for instantiating the referenced control graph?
You can override SceneGraph
public class MySceneGraph : SceneGraph<MyGraph> {
private void Awake() {
graph = graph.Copy();
graph.transformTarget = this;
}
}
I have an idea to make the xnode simple scripting tool for artists, but as i've understand from wiki currently there is no way to create a prefabs with graphs for reusability. If there was a way to convert the scriptable asset to a conventional cs script it would be nice to know where to start. Anybody had any experience with creating procedural code that way?