mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
52 lines
2.4 KiB
Markdown
52 lines
2.4 KiB
Markdown
[](https://discord.gg/qgPrHv4)
|
|
[](https://github.com/Siccity/UnityNodeEditorCore/issues)
|
|
[](https://raw.githubusercontent.com/Siccity/UnityNodeEditorCore/master/LICENSE.md)
|
|
[](https://github.com/Siccity/UnityNodeEditorCore/wiki)
|
|
|
|
### UnityNodeEditorCore
|
|
Thinking of developing a node-based plugin? Then this is for you. You can download it as an archive and unpack to a new unity project, or connect it as git submodule.
|
|
|
|
With a minimal footprint, UNEC is ideal as a base for custom state machines, dialogue systems, decision makers etc.
|
|
|
|

|
|
|
|
### Key features of UnityNodeEditorCore:
|
|
* Lightweight in runtime
|
|
* Very little boilerplate code
|
|
* Strong separation of editor and runtime code
|
|
* No runtime reflection (unless you need to edit/build node graphs at runtime. In this case, all reflection is cached.)
|
|
* Does not rely on any 3rd party plugins
|
|
* Custom node inspector code is very similar to regular custom inspector code
|
|
|
|
### Node example:
|
|
```csharp
|
|
[System.Serializable]
|
|
public class MathNode : Node {
|
|
[Input] public float a;
|
|
[Input] public float b;
|
|
[Output] public float result;
|
|
public enum MathType { Add, Subtract, Multiply, Divide}
|
|
public MathType mathType = MathType.Add;
|
|
|
|
public override object GetValue(NodePort port) {
|
|
if (port.fieldName == "result") {
|
|
float a = GetInputFloat("a");
|
|
float b = GetInputFloat("b");
|
|
switch(mathType) {
|
|
case MathType.Add: return a + b;
|
|
case MathType.Subtract: return a - b;
|
|
case MathType.Multiply: return a * b;
|
|
case MathType.Divide: return a / b;
|
|
}
|
|
}
|
|
return 0f;
|
|
}
|
|
}
|
|
```
|
|
|
|
Join the [Discord](https://discord.gg/qgPrHv4 "Join Discord server") server to leave feedback or get support.
|
|
Feel free to also leave suggestions/requests in the [issues](https://github.com/Siccity/UnityNodeEditorCore/issues "Go to Issues") page.
|
|
|
|
Projects using UnityNodeEditorCore:
|
|
* [Graphmesh](https://github.com/Siccity/Graphmesh "Go to github page")
|