void UpdateTriggeredOutputs()
 {
     foreach (DockOutput dockOutput in outputs)
     {
         foreach (DockInput dockInput in dockOutput.targets)
         {
             Node_EnumState enumStateNode = (Node_EnumState)dockInput.node;
             string         key           = dockInput.typeHolder.type.ToString();
             enumStateNode.stackState.stacks [key]
             .HandleInsertRemove(this, isTriggered, modifierStackState.state [key]);
         }
     }
 }
    void Update()
    {
        if (nodeEditorGO == null)
        {
            nodeEditorGO = GameObject.Find(nodeEditorName);
        }
        NodeEditor nodeEditor = nodeEditorGO.GetComponent <NodeEditor> ();

        Node_EnumState nodeEnumState = (Node_EnumState)nodeEditor.nodeLogic.nodes
                                       .Find((x) => x.GetType() == typeof(Node_EnumState));

        if (nodeEnumState != null)
        {
            stackState = nodeEnumState.stackState;
        }
    }
Beispiel #3
0
    public override void OnGUI()
    {
        Node_EnumState n = (Node_EnumState)node;

        backgroundColor = Color.yellow;

        foreach (DockInput dockInput in n.inputs)
        {
            GUILayout.BeginHorizontal();
            DrawDock(dockInput);
            string enumTypeStr = dockInput.typeHolder.type.ToString();
            // render popup
            n.stackState.ChangeSubState(enumTypeStr, popup.EnumPopup((System.Enum)n.stackState.state [enumTypeStr]));
            DrawTooltip(enumTypeStr.Substring(enumTypeStr.LastIndexOf('+') + 1));
            GUILayout.EndHorizontal();
        }
    }