Esempio n. 1
0
    public override void NodeGUI()
    {
        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();

        GUILayout.Label(block1Connection.name);
        block1Connection.SetPosition();

        GUILayout.Label(block2Connection.name);
        block2Connection.SetPosition();

        GUILayout.EndVertical();
        GUILayout.BeginVertical();

        GUILayout.Label(outputConnection.name);
        outputConnection.SetPosition();

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        RTEditorGUI.EnumPopup(new GUIContent("Combine", "The combination type to use"), mode, m => {
            if (mode != m)
            {
                mode = m;
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        });

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Esempio n. 2
0
        public override void NodeGUI()
        {
            // value = RTEditorGUI.FloatField(new GUIContent("Value", "The input value of type float"), value);
            inputType = (InputType)RTEditorGUI.EnumPopup(new GUIContent("Input type:", ""), inputType);
            RTEditorGUI.Space();

            switch (inputType)
            {
            case InputType.player:
                playerValue = (PlayerValue)RTEditorGUI.EnumPopup(new GUIContent("Players value:", ""), playerValue);
                break;

            case InputType.agent:
                agentValue = (AgentValue)RTEditorGUI.EnumPopup(new GUIContent("This Agents value:", ""), agentValue);
                break;

            case InputType.world:
                worldValue = (WorldValue)RTEditorGUI.EnumPopup(new GUIContent("The Worlds value:", ""), worldValue);
                break;

            default:
                break;
            }

            outputKnob.SetPosition();

            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        }
        public override void NodeGUI()
        {
            GUILayout.Space(5);
            GUILayout.BeginVertical("Box");
            GUILayout.BeginHorizontal();
            GUILayout.Label(new GUIContent("Actor", tooltip_name), GUILayout.Width(55f));
            actor = GUILayout.TextField(actor, GUILayout.Width(MinSize.x - 75));
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.Label(new GUIContent("Emotion", tooltip_name), GUILayout.Width(55f));
            emotion = (Emotion)RTEditorGUI.EnumPopup(emotion, GUILayout.Width(MinSize.x - 75));
            GUILayout.EndHorizontal();
            GUILayout.Space(3);
            GUILayout.EndVertical();

            GUILayout.BeginHorizontal();
            GUILayout.Label(new GUIContent("Dialog Text", tooltip_text), NodeEditorGUI.nodeLabelBoldCentered);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUIStyle dialogTextStyle = new GUIStyle(GUI.skin.textArea);

            dialogTextStyle.wordWrap = true;
            text = GUILayout.TextArea(text, GUI.skin.textArea, GUILayout.MinHeight(RTEditorGUI.lineHeight * 5));
            GUILayout.EndHorizontal();

            //Don't know why this code needs to be here exactly, but it makes everything nicer? maybe add to some static stuff?
            GUILayout.BeginHorizontal();
            RTEditorGUI.labelWidth = 50;
            GUILayout.EndHorizontal();
        }
Esempio n. 4
0
        public override void NodeGUI()
        {
            GUILayout.Space(5);
            GUILayout.BeginVertical("Box");
            waitUntilFinished = RTEditorGUI.Toggle(waitUntilFinished, new GUIContent("Wait While Playing"));
            character         = RTEditorGUI.TextField(new GUIContent("Character", "The character to be moved. Should have an EntityController in-scene. " + DialogStartNode.extenalDependencyTooltip), character);
            destination       = RTEditorGUI.TextField(new GUIContent("Destination Object", "The object to move to." + DialogStartNode.extenalDependencyTooltip), destination);
            speed             = RTEditorGUI.FloatField("Speed", speed);
            GUILayout.BeginHorizontal();
            GUILayout.Label(new GUIContent("X Leniency"));
            xLeniency.min = RTEditorGUI.FloatField(xLeniency.min, GUILayout.Width(58));
            GUILayout.Space(2);
            xLeniency.max = RTEditorGUI.FloatField(xLeniency.max, GUILayout.Width(58));
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.Label(new GUIContent("Y Leniency"));
            yLeniency.min = RTEditorGUI.FloatField(yLeniency.min, GUILayout.Width(58));
            GUILayout.Space(2);
            yLeniency.max = RTEditorGUI.FloatField(yLeniency.max, GUILayout.Width(58));
            GUILayout.EndHorizontal();
            endFacing = (Direction)RTEditorGUI.EnumPopup("End Facing", endFacing);
            GUILayout.EndVertical();

            //Don't know why this code needs to be here exactly, but it makes everything nicer? maybe add to some static stuff?
            GUILayout.BeginHorizontal();
            RTEditorGUI.labelWidth = 50;
            GUILayout.EndHorizontal();
        }
Esempio n. 5
0
    public override void NodeGUI()
    {
        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();
        input.DisplayLayout();

        GUILayout.BeginHorizontal();
        GUILayout.Label(surfaceConnection.name);
        if (!surfaceConnection.connected())
        {
            surface = RTEditorGUI.FloatField(GUIContent.none, surface);
        }

        surfaceConnection.SetPosition();
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        RTEditorGUI.EnumPopup(new GUIContent("Generation", "The type of Vertex generation"), mode, m =>
        {
            if (mode != m)
            {
                mode = m;
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        });

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Esempio n. 6
0
 public override void NodeGUI()
 {
     GUILayout.BeginHorizontal();
     GUILayout.BeginVertical();
     input.DisplayLayout();
     GUILayout.EndVertical();
     GUILayout.EndHorizontal();
     mode = (MarchingMode)RTEditorGUI.EnumPopup(new GUIContent("Vertex Generation", "The type of Vertex generation"), mode);
 }
Esempio n. 7
0
        protected override void DrawConfigurationGUI()
        {
            base.DrawConfigurationGUI();
            _passType = (PassType)RTEditorGUI.EnumPopup("Pass type", _passType);

            if (_passType == PassType.High || _passType == PassType.Range)
            {
                _min = RTEditorGUI.FloatField("Min", _min);
            }

            if (_passType == PassType.Low || _passType == PassType.Range)
            {
                _max = RTEditorGUI.FloatField("Max", _max);
            }
        }
        public override void NodeGUI()
        {
            outputKnob.DisplayLayout();

            _frequency  = RTEditorGUI.FloatField(new GUIContent("Frequency"), _frequency);
            _lacunarity = RTEditorGUI.FloatField(new GUIContent("Lacunarity"), _lacunarity);
            _octaves    = RTEditorGUI.IntField(new GUIContent("Octaves"), _octaves);
            _seed       = SeedGUIUtils.SeedInput(_seedInputKnob, _seed);
            _quality    = (QualityMode)RTEditorGUI.EnumPopup(new GUIContent("Quality"), _quality);

            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        }
        public override void NodeGUI()
        {
            RTEditorGUI.labelWidth = 50;
            GUILayout.Space(5);
            GUILayout.BeginVertical("Box");
            waitUntilFinished = RTEditorGUI.Toggle(waitUntilFinished, new GUIContent("Wait While Playing"));
            character         = RTEditorGUI.TextField(new GUIContent("Character", "The character to be moved. Should have an EntityController in-scene. " + DialogStartNode.extenalDependencyTooltip), character);
            facing            = (Direction)RTEditorGUI.EnumPopup(new GUIContent("Direction"), facing);
            GUILayout.EndVertical();

            //Don't know why this code needs to be here exactly, but it makes everything nicer? maybe add to some static stuff?
            GUILayout.BeginHorizontal();
            RTEditorGUI.labelWidth = 50;
            GUILayout.EndHorizontal();
        }
 public override void NodeGUI()
 {
     GUILayout.Space(5);
     GUILayout.BeginVertical("Box");
     GUILayout.Label(new GUIContent("Data to Test", tooltip_data), NodeEditorGUI.nodeLabelBoldCentered);
     GUILayout.BeginHorizontal();
     exprType = (controlExpressionType)RTEditorGUI.EnumPopup(exprType, GUILayout.Width(75));
     if (exprType == controlExpressionType.Variable)
     {
         variableName = GUILayout.TextField(variableName, GUILayout.Width(200f));
     }
     GUILayout.Space(5);
     GUILayout.EndHorizontal();
     GUILayout.EndVertical();
     GUILayout.BeginVertical();
     if (listGUI == null)
     {
         RKnobListGUI <BranchCase> .ElementGUI eGUI = (elt, rect) =>
         {
             #if UNITY_EDITOR
             float xOffset = 0;
             Rect  UIrect  = new Rect(rect.x, rect.y + 2, 60, RTEditorGUI.lineHeight);
             elt.type    = (BranchCase.CaseType)EditorGUI.EnumPopup(UIrect, GUIContent.none, elt.type);
             xOffset    += (UIrect.width + 2);
             UIrect      = new Rect(rect.x + xOffset, rect.y + 1, 170, RTEditorGUI.lineHeight);
             elt.pattern = GUI.TextField(UIrect, elt.pattern);
             xOffset    += (UIrect.width + 2);
             UIrect      = new Rect(rect.x + xOffset, rect.y + 1, 20, RTEditorGUI.lineHeight);
             xOffset    += (UIrect.width + 2);
             UIrect      = new Rect(rect.x + xOffset, rect.y + 1, 20, RTEditorGUI.lineHeight);
             #endif
         };
         listGUI = new RKnobListGUI <BranchCase>(cases, new GUIContent("Branch Cases"), eGUI,
                                                 (elt) => RTEditorGUI.lineHeight, (item) => new ConnectionKnob[] { item.connection },
                                                 (item, rect) => item.connection.SetPosition(rect.yMin + (NodeEditorGUI.knobSize * 2) - 3),
                                                 () => new BranchCase(this));
     }
     listGUI.DoLayoutList();
     GUILayout.EndVertical();
     GUILayout.BeginVertical("Box");
     GUILayout.Label(new GUIContent("Default Branch", tooltip_branch_default), NodeEditorGUI.nodeLabelBoldCentered);
     toDefaultBranch.SetPosition();
     GUILayout.EndVertical();
 }
Esempio n. 11
0
        public override void NodeGUI()
        {
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical();

            // First input
            if (input1Knob.connected())
            {
                GUILayout.Label(input1Knob.name);
            }
            else
            {
                Input1Val = RTEditorGUI.FloatField(GUIContent.none, Input1Val);
            }
            input1Knob.SetPosition();

            // Second input
            if (input2Knob.connected())
            {
                GUILayout.Label(input2Knob.name);
            }
            else
            {
                Input2Val = RTEditorGUI.FloatField(GUIContent.none, Input2Val);
            }
            input2Knob.SetPosition();

            GUILayout.EndVertical();
            GUILayout.BeginVertical();

            // Output
            outputKnob.DisplayLayout();

            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            type = (CalcType)RTEditorGUI.EnumPopup(new GUIContent("Calculation Type", "The type of calculation performed on Input 1 and Input 2"), type);

            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        }
        public override void NodeGUI()
        {
            RTEditorGUI.labelWidth = 50;
            GUILayout.Space(5);
            GUILayout.BeginVertical("Box");
            waitUntilFinished = RTEditorGUI.Toggle(waitUntilFinished, new GUIContent("Wait While Playing"));
            target            = RTEditorGUI.TextField(new GUIContent("Target object", "The GameObject to move to. " + DialogStartNode.extenalDependencyTooltip), target);
            movementType      = (MoveType)RTEditorGUI.EnumPopup(new GUIContent("Movement Type"), movementType);
            if (movementType == MoveType.Linear)
            {
                maxPullSpeed = RTEditorGUI.FloatField("Speed", maxPullSpeed);
            }
            else
            {
                maxPullSpeed = RTEditorGUI.FloatField("Max Pull Speed", maxPullSpeed);
                snapTime     = RTEditorGUI.FloatField("Snap Time", snapTime);
            }
            GUILayout.EndVertical();

            //Don't know why this code needs to be here exactly, but it makes everything nicer? maybe add to some static stuff?
            GUILayout.BeginHorizontal();
            RTEditorGUI.labelWidth = 50;
            GUILayout.EndHorizontal();
        }
Esempio n. 13
0
 protected override void DrawConfigurationGUI()
 {
     base.DrawConfigurationGUI();
     _combineMode = (CombineMode)RTEditorGUI.EnumPopup("Combine mode", _combineMode);
 }