### Key features * 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 * Supported from Unity 5.3 and up ### Wiki * [Getting started](https://github.com/Siccity/xNode/wiki/Getting%20Started) - create your very first node node and graph * [Examples branch](https://github.com/Siccity/xNode/tree/examples) - look at other small projects ### Installing with Unity Package Manager ***Via Git URL*** *(Requires Unity version 2018.3.0b7 or above)* To install this project as a [Git dependency](https://docs.unity3d.com/Manual/upm-git.html) using the Unity Package Manager, add the following line to your project's `manifest.json`: ``` "com.github.siccity.xnode": "https://github.com/siccity/xNode.git" ``` You will need to have Git installed and available in your system's PATH. If you are using [Assembly Definitions](https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html) in your project, you will need to add `XNode` and/or `XNodeEditor` as Assembly Definition References. ***Via OpenUPM*** The package is available on the [openupm registry](https://openupm.com). It's recommended to install it via [openupm-cli](https://github.com/openupm/openupm-cli). ``` openupm add com.github.siccity.xnode ``` ### Node example: ```csharp // public classes deriving from Node are registered as nodes for use within a graph public class MathNode : Node { // Adding [Input] or [Output] is all you need to do to register a field as a valid port on your node [Input] public float a; [Input] public float b; // The value of an output node field is not used for anything, but could be used for caching output results [Output] public float result; [Output] public float sum; // The value of 'mathType' will be displayed on the node in an editable format, similar to the inspector public MathType mathType = MathType.Add; public enum MathType { Add, Subtract, Multiply, Divide} // GetValue should be overridden to return a value for any specified output port public override object GetValue(NodePort port) { // Get new a and b values from input connections. Fallback to field values if input is not connected float a = GetInputValue