void Update()
    {
        if (nodeEditorGO == null)
        {
            nodeEditorGO = GameObject.Find(nodeEditorName);
        }
        NodeEditor nodeEditor = nodeEditorGO.GetComponent <NodeEditor> ();

        Node_Movement nodeMovement = (Node_Movement)nodeEditor.nodeLogic.nodes
                                     .Find((x) => x.GetType() == typeof(Node_Movement));

        if (nodeMovement != null)
        {
            movementVector = (Vector3)nodeMovement.GetDockOutputByName("result").value;
        }
    }
Beispiel #2
0
    public override void OnGUI()
    {
        Node_Movement n = (Node_Movement)node;

        backgroundColor = Color.blue;

        foreach (DockInput dockInput in n.inputs)
        {
            GUILayout.BeginHorizontal();
            DrawDock(dockInput);
            GUILayout.Label(dockInput.name);
            GUILayout.EndHorizontal();
        }
        GUILayout.BeginHorizontal();
        DockOutput dockOutput = n.GetDockOutputByName("result");

        GUILayout.Box(dockOutput.value.ToString());
        DrawDock(dockOutput);
        GUILayout.EndHorizontal();
    }