A visual node graph editor for Unity, built from scratch using the GraphView API — designed to power event-driven, flow-based gameplay logic through a ScriptableObject architecture.
Node Graph Editor (com.cjhawk.graphnodeeditor) is a Unity Editor package that provides a fully functional, extensible visual node graph system. Graphs are stored as ScriptableObject assets, and the editor is powered by Unity's GraphView API.
It supports two execution models out of the box:
- Event-driven execution — nodes fire in response to Unity events (collision, key press, mouse click, etc.)
- Linear sequential execution — nodes execute one after another in a defined flow
- ✅ Visual Node Graph Editor — drag-and-drop canvas with zoom, pan, and grid background
- ✅ ScriptableObject-Based Graphs — graphs persist as Unity assets (
GraphAssetSO) - ✅ Search Window — quickly add nodes by name via a searchable popup
- ✅ Node Inspector — inspect and edit node properties in a dedicated panel when a node is selected
- ✅ Copy / Paste — duplicate nodes with
Ctrl/Cmd+CandCtrl/Cmd+V, with offset positioning - ✅ Undo / Redo — full Unity Undo integration for all graph mutations
- ✅ Delete — remove selected nodes and their connections via
Deletekey or context menu - ✅ Frame All — press
Fto fit all nodes in view - ✅ Parallel Execution —
ParallelNodewith configurable output count for branching logic - ✅ Custom Node Attributes — annotate fields with
[ExposedProperty],[NodeInfo],[DisplayName], and more - ✅ Event Nodes — built-in nodes for
OnEnable,OnFrameUpdate,OnKeyPress,OnMouseClick,OnCollisionEnter,OnTriggerEnter - ✅ Action Nodes — built-in nodes for
Move,Rotate,WaitForSeconds,Timer,DebugLog - ✅ Scene Object Support — reference in-scene GameObjects from graph assets via
SceneObject
| Requirement | Version |
|---|---|
| Unity | 2022.3.21f1 or later |
| Render Pipeline | Any (URP, HDRP, Built-in) |
- Open Unity → Window → Package Manager
- Click the
+button → Add package from git URL - Enter:
https://github.com/Selva1910/NodeGraphEditor.git
- Clone or download this repository
- Copy the package folder into your project's
Packages/directory - Unity will automatically detect and import it
In the Project window, right-click and navigate to:
NodeGraph → Asset
This creates a new GraphAssetSO file in your project.
Double-click any GraphAssetSO asset to open the Node Graph Editor window.
- Right-click on the canvas or press Space to open the node search window
- Select a node type to add it to the graph
- Drag from an Out port to an In port on another node to create a connection
- Connections only form between compatible port types
Attach an EventGraphViewController or LinearGraphViewController component to a GameObject and assign your GraphAssetSO to drive runtime execution.
NodeGraphEditor/
├── Editor/ # Unity Editor-only code
│ ├── BaseGraphView.cs # Core GraphView canvas (zoom, pan, CRUD, clipboard)
│ ├── GraphNodeEditor.cs # Visual node element with port rendering
│ ├── GraphEditorWindow.cs # EditorWindow host for the graph canvas
│ ├── GraphAssetEditor.cs # Custom Inspector for GraphAssetSO
│ ├── GraphWindowSearchProvider.cs# Searchable node creation popup
│ ├── NodeInspector.cs # Per-node property inspector panel
│ ├── MenuManager.cs # Editor menu items
│ ├── PortTypes.cs # Port type definitions
│ ├── SceneObjectPickerDrawer.cs # Custom property drawer for SceneObject
│ ├── SceneObjectPropertyDrawer.cs
│ ├── Resources/ # Editor resources (icons, USS styles)
│ └── USS/ # Unity Style Sheets for graph theming
│
└── Runtime/ # Runtime execution code
├── GraphAssetSO.cs # ScriptableObject graph data model
├── BaseGraphNode.cs # Base class for all nodes
├── GraphConnection.cs # Port connection data model
├── INode.cs # Node interface
├── INodeLifeCycle.cs # Lifecycle hooks (OnNodeEnter, OnNodeExit)
├── EventGraphViewController.cs # Event-driven graph execution controller
├── LinearGraphViewController.cs# Sequential graph execution controller
├── EventManager.cs # Central graph event dispatcher
├── InputEventManager.cs # Input event bridging for graphs
├── SceneObject.cs # Serializable in-scene object reference
├── SceneObjectManager.cs # Scene object registration & lookup
├── Attributes/ # Custom C# attributes for node authoring
│ ├── NodeInfoAttribute.cs # [NodeInfo] — title, menu path, port config
│ ├── ExposedPropertyAttribute.cs # [ExposedProperty] — show field in node
│ ├── ExposedInNodeAttribute.cs # [ExposedInNode] — render as input port
│ └── SceneObjectPickerAttribute.cs
├── Properties/ # Serializable property wrapper types
└── Types/ # Built-in node implementations
├── EntryNode.cs
├── ParallelNode.cs
├── TimerNode.cs
├── WaitForSecondsNode.cs
├── MoveNode.cs
├── RotateNode.cs
├── DebugLogNode.cs
├── OnEnableNode.cs
├── OnFrameUpdateNode.cs
├── OnKeyPressNode.cs
├── OnMouseClickNode.cs
├── OnCollisionEnterNode.cs
└── OnTriggerEnterNode.cs
Extend BaseGraphNode and annotate it with [NodeInfo] to register it in the editor.
using NodeGraph;
using UnityEngine;
[NodeInfo(
title: "My Custom Node",
menuItem: "Custom/My Custom Node",
hasFlowInputs: true,
hasFlowOutputs: true
)]
public class MyCustomNode : BaseGraphNode, INodeLifeCycle
{
[ExposedProperty]
[DisplayName("Message")]
public string message = "Hello!";
public void OnNodeEnter()
{
Debug.Log(message);
}
public void OnNodeExit() { }
}| Attribute | Description |
|---|---|
[NodeInfo] |
Registers title, search menu path, and flow port configuration |
[ExposedProperty] |
Exposes a field in the node body and inspector |
[DisplayName] |
Overrides the display label of a field |
[ExposedInNode] |
Renders an exposed field as a dedicated input port |
[ExposedOutNode] |
Renders an exposed field as a dedicated output port |
INodeLifeCycle |
Provides OnNodeEnter() and OnNodeExit() callbacks |
| Shortcut | Action |
|---|---|
Space / Right-click |
Open node search window |
F |
Frame all nodes in view |
Ctrl/Cmd + C |
Copy selected nodes |
Ctrl/Cmd + V |
Paste copied nodes |
Delete |
Delete selected nodes and connections |
This project was inspired by and built upon concepts from the following YouTube live series:
🎬 Building A Node Editor Tool In Unity — Graph View (Live Session)
A huge thanks to the author of this live session for a clear, in-depth walkthrough of Unity's
GraphViewAPI. This series laid the conceptual foundation for the node graph architecture used in this package.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) — see the LICENSE file for details.
Key implications of AGPL-3.0:
- You may use, modify, and distribute this software freely
- Any modified version must also be released under AGPL-3.0
- If you run a modified version over a network, you must make the source code available to users
Selvaraj Balakrishnan