Example #1
0
    private void ToggleCheckGlobalFlag(bool record = true)
    {
        if (record)
        {
            HistoryManager.RecordNode(this);
        }

        nodeType = NodeType.CheckGlobalFlag;
        title    = "CHECK GLOBAL FLAG";

        style         = new GUIStyle(SDEStyles.nodeSmallDefault);
        defaultStyle  = new GUIStyle(SDEStyles.nodeSmallDefault);
        selectedStyle = new GUIStyle(SDEStyles.nodeSmallSelected);

        rect.width       = NodeManager.FLAG_WIDTH;
        rect.height      = NodeManager.FLAG_HEIGHT;
        clickRect.width  = NodeManager.FLAG_WIDTH;
        clickRect.height = NodeManager.FLAG_HEIGHT;

        globalItemDropdown = ScriptableObject.CreateInstance <DropdownGlobalItemBox>();
        globalItemDropdown.Init();

        // bind the dropdown to the global flag list
        globalItemDropdown.LoadItems(GlobalFlags.flags);

        splitter = ScriptableObject.CreateInstance <OutstreamSplitter>();
        splitter.Init(SplitterType.Flag);
    }
Example #2
0
    private void ToggleSetGlobalFlag(bool record = true)
    {
        if (record)
        {
            HistoryManager.RecordNode(this);
        }

        nodeType = NodeType.SetGlobalFlag;
        title    = "SET GLOBAL FLAG";

        style         = new GUIStyle(SDEStyles.nodeSmallDefault);
        defaultStyle  = new GUIStyle(SDEStyles.nodeSmallDefault);
        selectedStyle = new GUIStyle(SDEStyles.nodeSmallSelected);

        rect.width       = NodeManager.FLAG_WIDTH;
        rect.height      = NodeManager.FLAG_HEIGHT;
        clickRect.width  = NodeManager.FLAG_WIDTH;
        clickRect.height = NodeManager.FLAG_HEIGHT;

        outPoint = ScriptableObject.CreateInstance <ConnectionPoint>();
        outPoint.Init(this, ConnectionPointType.Out);

        globalItemDropdown = ScriptableObject.CreateInstance <DropdownGlobalItemBox>();
        globalItemDropdown.Init();

        // bind the dropdown to the global flag list
        globalItemDropdown.LoadItems(GlobalFlags.flags);
    }
Example #3
0
    // helper function of ToggleSetGlobalVariable() and ToggleCheckGlobalVariable()
    private void ToggleGlobalVariable()
    {
        style         = new GUIStyle(SDEStyles.nodeSmallDefault);
        defaultStyle  = new GUIStyle(SDEStyles.nodeSmallDefault);
        selectedStyle = new GUIStyle(SDEStyles.nodeSmallSelected);

        rect.width       = NodeManager.VARIABLE_WIDTH;
        rect.height      = NodeManager.VARIABLE_HEIGHT;
        clickRect.width  = NodeManager.VARIABLE_WIDTH;;
        clickRect.height = NodeManager.VARIABLE_HEIGHT;

        globalItemDropdown = ScriptableObject.CreateInstance <DropdownGlobalItemBox>();
        globalItemDropdown.Init();

        // bind the dropdown to the global variables list
        globalItemDropdown.LoadItems(GlobalVariables.variables);

        // instantiate the check field
        globalVariableField = ScriptableObject.CreateInstance <TextArea>();
        globalVariableField.Init(this, "0", 50);
        globalVariableField.parentOffset = new Vector2(140, -1);
        globalVariableField.maxLength    = 4;
    }