summaryrefslogtreecommitdiff
path: root/Other/NodeEditorExamples/Assets/UNEB/Nodes/BasicNode.cs
blob: fd9ea801b45b83ba5f0092876071a39aef128687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

using UnityEngine;
using UnityEditor;

namespace UNEB
{
    public class BasicNode : Node
    {
        private int _someInt = 0;

        public override void Init()
        {
            base.Init();

            AddInput("Input");
            AddOutput("Ouput");

            FitKnobs();

            // Fit the int field, need to automate this.
            bodyRect.height += 20f;
        }

        public override void OnBodyGUI()
        {
            _someInt = EditorGUILayout.IntField("Int Value", _someInt);
        }

        public override void OnNewInputConnection(NodeInput addedInput)
        {
            Debug.Log("Added Input: " + addedInput.name);
        }

        public override void OnInputConnectionRemoved(NodeInput removedInput)
        {
            Debug.Log("Removed Input: " + removedInput.name);
        }
    }
}