• Stars
    star
    138
  • Rank 263,397 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unity graph editor extension.

#NodeInspector If you like to use scriptable object as config files you probably know how hard is maintain references from one object to another. This project would help you to organize your objects.

this is what you will get at the end of this simple tutorial

Simple nodes

#Graph Graph is a set of nodes connected by references. In our case we have ScriptableObject as a graph nodes. To start work what we need is to define Graph scriptable object which will keep links to all nodes. and all nodes just need to be inherited from ScriptableObjectNode class. If you open this class you will find that it just have one more property WindowRect. this property used in inspector to store information about node position.

It's possible that you want to store information about start node you can use it as well using directives. so let's start implement this

#MyConfig.cs I'll create test class which will keep some properties and have a link to another object.

using UnityEngine;
using NodeInspector;

[NodeMenuItem("MyConfigNode")] //This directive create option menu in the inspector
[OneWay]       // If you won't provide this attribute you won't be abble to link to this instance as inputnode
public class MyConfigNode : ScriptableObjectNode {
    [OneWay]  //next property will have output link to another node
    public MyConfigNode LinkToNode;
    public int          TestInt;
    public LayerMask    TestLayerMask;
    [OneWay]
    public MyConfigNode LinkToAdditionalNode;
}

As you see it's really simple class you just keep some properties here.

#MyConfigNodeHolder

using UnityEngine;
using System.Collections.Generic;
using NodeInspector;

[CreateAssetMenu] //This is standard unity feature. Create instance of this object in assets
public class MyConfigHolder : ScriptableObject { 
    [Graph("StartNode")] //this is a name of the property of this class
    public List<MyConfigNode> Nodes;

    public MyConfigNode StartNode; //if you don't need a start node you don't need to use Graph parameter
}

you can use several graphs at one scriptable object. but you graph must be a List of ScriptableObjectNode type or classes deprived from it.

So this is it. now you can create instance of your ConfigHodler object and start work with you graph. Right click at your project window and select Create/My Config Holder after that you will have just asset in the folder. to start working with it you need to open node inspector it located at the top unity bar Window/Node Inspector

At the top left corner of the inspector you will find menu which create instances of your node. This is it. now you can freely connect your nodes as you wish. and if you want to create some node as start node just use context menu or toplight menu of the nodes.

More Repositories

1

colorus

Unity3d ColoringBook web/ios
C#
87
star
2

unity-spine-importer

Bring data from spine (EsotericSoftware) in to the unity3d
C#
37
star
3

ecs-damage-bubbles

Instancing multiple damage texts on screen
C#
23
star
4

appirater-unity

Unity ios rate us plugin
C#
13
star
5

unity-navigation-history

Window which track visited game objects, prefab etc. From this window you can select object which you can recently visited.
C#
10
star
6

atlasToCube

Unity3d utility to put any texture from atlas to different faces of cube
C#
6
star
7

nginx-icinga-nagios-plugin

icinga, nagios check nginx process status
6
star
8

unity3d-lzma-speedup-macos

Speedup unity3d web build compression
4
star
9

pipler

Pipler - original prototype
C#
3
star
10

persistentSingleton

Unity plugin which store/read properties from/to singleton to UserPrefs
C#
3
star
11

unity-work-with-curve

Trying to find out how to create curve through script in unity3d
C#
3
star
12

VFXText

VFX Text Particles
C#
2
star
13

Derevo

Unity3d project from singapore 2012 gamejam
JavaScript
2
star
14

unity3d-google-site-gadget

Insert unity3d webplayer to google sites.
2
star
15

unity3d-atlasEditor

C#
1
star
16

dragndrop2

JavaScript
1
star
17

pgg-ecs-demo

Demonstrate how to generate level with "Procedural Generation Grid" package in ecs way
C#
1
star
18

theta-star-pathfinding-unity

Example project with Theta* (Theta star) pathfinding algorithm implemented on unity
C#
1
star
19

unity2mailru

Unity3d c# Адаптер для js функций mail.ru api
C#
1
star
20

Unity2d-GroundCheck

Ground check script utilizing unity5 IsTouchingLayers feature
C#
1
star