Search Unity

OpenSource graph node editor

Discussion in 'Immediate Mode GUI (IMGUI)' started by nicloay, Feb 17, 2017.

  1. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Let me share my project.
    It's a node editor which you can use in your own project (even commercial)



    This is how you can create your node types
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using NodeInspector;
    4.  
    5. [NodeMenuItem("MyConfigNode")] //This directive create option menu in the inspector
    6. [OneWay]       // If you won't provide this attribute you won't be abble to link to this instance as inputnode
    7. public class MyConfigNode : ScriptableObjectNode {
    8.    [OneWay]  //next property will have output link to another node
    9.    public MyConfigNode LinkToNode;
    10.    public int          TestInt;
    11.    public LayerMask    TestLayerMask;
    12.    [OneWay]
    13.    public MyConfigNode LinkToAdditionalNode;
    14. }
    15.  
    And this is top level node holder
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections.Generic;
    4. using NodeInspector;
    5.  
    6. [CreateAssetMenu] //This is standard unity feature. Create instance of this object in assets
    7. public class MyConfigHolder : ScriptableObject {
    8.    [Graph("StartNode")] //this is a name of the property of this class
    9.    public List<MyConfigNode> Nodes;
    10.  
    11.    public MyConfigNode StartNode; //if you don't need a start node you don't need to use Graph parameter
    12. }
    13.  
    That's it.

    Read quick start guide
    And you can even find simple dialogue editor inside

    Hope someone will like it =)
     
    Izzy2000 likes this.