rygo6 / GTLogicGraph

A generic graph made off the UIElement GraphView built into Unity.
Other
211 stars 19 forks source link

Could I trouble you for a high level overview, maybe in the wiki? #3

Open jwvanderbeck opened 4 years ago

jwvanderbeck commented 4 years ago

Thank you so much for putting this together, and I know its very much just a personal project that you've made available for us all to learn from.

If you feel up to it, and only if you feel up to it, I think it would be great to make a wiki page that covers sort of the high level overview of how this all works. What the various pieces are and how they connect.

I am trying to implement something for my company based on the GraphView implementation of the VFX Graph which is similar to this but not exact. My main problem though is just getting my head wrapped around all the various pieces of the overall puzzle and how they connect.

rygo6 commented 4 years ago

I could at some point.

But really, a lot of the design and code layout isn't mine. It's replicated from the ShaderGraph library. Some of it I still haven't quite figured out why it is like that. I've not touched this project for a number of months waiting for Unity to develop the UI elements library more and get all of the classes out the experimental namespace in case more things change. I think that has generally happened now, so I could probably dig into this a bit more. Developing this more is definitely something I intend to do, as it's necessary for a future project of mine. But I have am working on a few different things at the moment.

rygo6 commented 4 years ago

I can describe a bit more quickly though.

Basically all the code inherited from the ShadeGraph has been refactored to output a JSON file which defines:

In the actual graph view, each node is defined by a 'LogicNodeEditor' script. The ones found here: https://github.com/rygo6/GTLogicGraph/tree/master/Scripts/Editor/Nodes

You can see the output JSON by looking here: https://github.com/rygo6/GTLogicGraph/blob/master/TestLogicGraph.LogicGraph

The GTLogicGraphInstance then takes in this JSON and will instantiate the non-editor nodes. The nodes found in this directory: https://github.com/rygo6/GTLogicGraph/tree/master/Scripts/LogicNodes

"LogicNode" classes define the logic of the node that will be executed in the actual scene. "LogicNodeEditor" classes define how they visually will look in the shader graph.

jwvanderbeck commented 4 years ago

Yeah I am aware this is pulled from ShaderGraph and that Unity did a horrible job separating logic from view, so I very much appreciate what you've done. Like I said, just trying to get a feel for all the working pieces and how they fit together.

That overview at least helps me get started so thanks.