Example #1
0
    public override void NodeGUI()
    {
        GUILayout.Label("打字类型");
        tapType = (TapType)EditorGUILayout.EnumPopup(tapType);
        // Display Float connections
        GUILayout.BeginHorizontal();
        inputKnob.DisplayLayout();
        outputKnob.DisplayLayout();
        GUILayout.EndHorizontal();
        GUILayout.BeginVertical();

        scroll = EditorGUILayout.BeginScrollView(scroll, GUILayout.Height(80));
        EditorStyles.textField.wordWrap = false;
        DialogLine = EditorGUILayout.TextArea(DialogLine, GUILayout.ExpandHeight(true));
        EditorStyles.textField.wordWrap = false;
        EditorGUILayout.EndScrollView();
        GUILayout.EndVertical();

        /*
         * // Get adjacent flow elements
         * Node flowSource = flowIn.connected ()? flowIn.connections[0].body : null;
         * List<Node> flowTargets = flowOut.connections.Select ((ConnectionKnob input) => input.body).ToList ();
         *
         * // Display adjacent flow elements
         * GUILayout.Label ("Flow Source: " + (flowSource != null? flowSource.name : "null"));
         * GUILayout.Label ("Flow Targets:");
         * foreach (Node flowTarget in flowTargets)
         *      GUILayout.Label ("-> " + flowTarget.name);
         */
    }
Example #2
0
    public override void NodeGUI()
    {
        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        inputVectorKnob.DisplayLayout();
        GUILayout.EndVertical();

        GUILayout.FlexibleSpace();

        GUILayout.BeginVertical();

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("x: {0:0.0000}", xValue));
        xOutputKnob.DisplayLayout();
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("y: {0:0.0000}", yValue));
        yOutputKnob.DisplayLayout();
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();

        GUILayout.EndHorizontal();

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #3
0
    public override void NodeGUI()
    {
        // Display Float connections
        GUILayout.BeginHorizontal();
        inputKnob.DisplayLayout();
        outputKnob.DisplayLayout();
        GUILayout.EndHorizontal();
        GUILayout.BeginVertical();
        GUILayout.BeginHorizontal();
        //GUILayout.BeginVertical();
        //GUILayout.EndVertical();
        CharacterPotrait = (Sprite)EditorGUILayout.ObjectField(CharacterPotrait, typeof(Sprite), false, GUILayout.Width(65f), GUILayout.Height(65f));
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();

        /*
         * // Get adjacent flow elements
         * Node flowSource = flowIn.connected ()? flowIn.connections[0].body : null;
         * List<Node> flowTargets = flowOut.connections.Select ((ConnectionKnob input) => input.body).ToList ();
         *
         * // Display adjacent flow elements
         * GUILayout.Label ("Flow Source: " + (flowSource != null? flowSource.name : "null"));
         * GUILayout.Label ("Flow Targets:");
         * foreach (Node flowTarget in flowTargets)
         *      GUILayout.Label ("-> " + flowTarget.name);
         */
    }
Example #4
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();

        // Last row, output box
        GUILayout.BeginHorizontal();
        // Input knobs
        GUILayout.BeginVertical();
        FloatKnobOrSlider(ref radius, 0, 10, radiusKnob);
        FloatKnobOrSlider(ref zoom, .0000000001f, 2, zoomKnob);
        FloatKnobOrSlider(ref bias, 0, 10, biasKnob);
        IntKnobOrSlider(ref maxIterations, 1, 100, maxIterationsKnob);
        IntKnobOrSlider(ref order, 1, 100, orderKnob);
        offsetKnob.DisplayLayout();
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Box(outputTex, GUILayout.MaxWidth(64), GUILayout.MaxHeight(64));
        GUILayout.EndHorizontal();

        GUILayout.Space(4);

        GUILayout.EndVertical();

        outputTexKnob.SetPosition(DefaultSize.x - 20);
        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #5
0
    public override void NodeGUI()
    {
        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();

        inputConnection.DisplayLayout();

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

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

        // Output
        outputConnection.DisplayLayout();

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

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #6
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();

        // Signal input knob and value label
        GUILayout.BeginHorizontal();
        signalKnob.DisplayLayout();
        GUILayout.Label(string.Format("value: {0:0.0000}", signalKnob.GetValue <float>()));
        GUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        GUILayout.BeginHorizontal();

        //Top/mid/bottom labels
        GUILayout.FlexibleSpace();
        GUILayout.BeginVertical();
        GUILayout.Label(string.Format("{0:0.00}", windowMaxY));
        GUILayout.FlexibleSpace();
        GUILayout.Label(string.Format("{0:0.00}", (windowMaxY + windowMinY) / 2));
        GUILayout.FlexibleSpace();
        GUILayout.Label(string.Format("{0:0.00}", windowMinY));
        GUILayout.EndVertical();

        GUILayout.Box(graphTexture, GUILayout.MaxWidth(256), GUILayout.MaxHeight(256));
        GUILayout.EndHorizontal();
        GUILayout.Space(4);
        GUILayout.EndVertical();
        outputTexKnob.SetPosition(DefaultSize.x - 20);
        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #7
0
    public override void NodeGUI()
    {
        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        controlSignalKnob.DisplayLayout();
        useRange = RTEditorGUI.Toggle(useRange, "Use range");
        if (useRange)
        {
            min = RTEditorGUI.FloatField("Min", min);
            max = RTEditorGUI.FloatField("Max", max);
            FloatKnobOrSlider(ref sensitivity, min, max, sensitivityKnob);
        }
        else
        {
            sensitivityKnob.DisplayLayout();
        }
        GUILayout.EndVertical();

        GUILayout.FlexibleSpace();
        GUILayout.Label(string.Format("Value: {0:0.0000}", latchedValue));
        outputSignalKnob.DisplayLayout();
        GUILayout.EndHorizontal();

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #8
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();
        stringexpr = RTEditorGUI.TextField(stringexpr);
        if (stringexpr != lastexpr)
        {
            lastexpr = stringexpr;
            Parse();
        }
        //Knob display
        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();
        aKnob.DisplayLayout();
        bKnob.DisplayLayout();
        GUILayout.EndVertical();
        if (errorMsg != null && errorMsg != "")
        {
            GUILayout.Label(string.Format("Error: {0}", errorMsg));
        }
        else
        {
            GUILayout.Label(string.Format("Result: {0:0.000}", output));
        }
        outputKnob.DisplayLayout();
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();


        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #9
0
    public override void NodeGUI()
    {
        //GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();

        speedInputKnob.DisplayLayout(new GUIContent("Speed", "The speed to pan in image widths/second"));
        if (!speedInputKnob.connected())
        {
            speed = RTEditorGUI.Slider(speed, -1, 1);
        }
        angleInputKnob.DisplayLayout(new GUIContent("Angle", "The angle to pan in radians"));
        if (!angleInputKnob.connected())
        {
            angle = RTEditorGUI.Slider(angle, 0, 6.2831f);
        }
        GUILayout.BeginHorizontal();
        smoothTransitions = RTEditorGUI.Toggle(smoothTransitions, new GUIContent("Smooth", "Whether the image panning should use bilinear filtering to produce smooth transitions"));
        mirror            = RTEditorGUI.Toggle(mirror, new GUIContent("Mirror", "Use mirror wraping at texture edges"));
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("Offset: ({0:0.00}, {1:0.00})", offset.x, offset.y));
        if (GUILayout.Button("Reset"))
        {
            offset = Vector2.zero;
        }
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        //GUILayout.EndHorizontal();

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #10
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();

        GUILayout.BeginHorizontal();
        RadioButtons(controllerChoice);
        GUILayout.EndHorizontal();

        LeftStickKnob.DisplayLayout();
        RightStickKnob.DisplayLayout();
        LeftTriggerKnob.DisplayLayout();
        RightTriggerKnob.DisplayLayout();
        dpadUpKnob.DisplayLayout();
        dpadDownKnob.DisplayLayout();
        dpadLeftKnob.DisplayLayout();
        dpadRightKnob.DisplayLayout();
        aKnob.DisplayLayout();
        bKnob.DisplayLayout();
        xKnob.DisplayLayout();
        yKnob.DisplayLayout();
        leftBumperKnob.DisplayLayout();
        rightBumperKnob.DisplayLayout();
        startKnob.DisplayLayout();
        backKnob.DisplayLayout();

        GUILayout.EndVertical();
        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #11
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);
        }
    }
Example #12
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();

        emissionRateKnob.DisplayLayout();
        if (!emissionRateKnob.connected())
        {
            emissionRate = RTEditorGUI.Slider(emissionRate, 0, 1000);
        }
        else
        {
            emissionRate = emissionRateKnob.GetValue <float>();
        }

        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Box(outputTex, GUILayout.MaxWidth(64), GUILayout.MaxHeight(64));
        GUILayout.EndHorizontal();
        GUILayout.Space(4);

        GUILayout.EndVertical();

        outputTexKnob.SetPosition(180);

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #13
0
 public override void NodeGUI()
 {
     inputTexKnob.SetPosition(20);
     GUILayout.BeginVertical();
     controlSignalKnob.DisplayLayout();
     if (!controlSignalKnob.connected())
     {
         controlSignal = RTEditorGUI.Slider(controlSignal, 0, 1);
     }
     else
     {
         controlSignal = controlSignalKnob.GetValue <float>();
     }
     GUILayout.FlexibleSpace();
     GUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     GUILayout.Box(outputTex, GUILayout.MaxWidth(64), GUILayout.MaxHeight(64));
     GUILayout.EndHorizontal();
     GUILayout.Space(4);
     GUILayout.EndVertical();
     outputTexKnob.SetPosition(180);
     if (GUI.changed)
     {
         NodeEditor.curNodeCanvas.OnNodeChange(this);
     }
 }
Example #14
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Previous"))
        {
            nextIndex = currentIndex == 0 ? animatedTextures.Length - 1 : currentIndex - 1;
        }
        ;
        if (GUILayout.Button("Next"))
        {
            nextIndex = (currentIndex + 1) % animatedTextures.Length;
        }
        ;
        GUILayout.EndHorizontal();
        GUILayout.Box(outputTex, GUILayout.MaxHeight(64));
        var newSpeed = RTEditorGUI.Slider(playbackSpeed, 0.1f, 4);

        if (newSpeed != playbackSpeed)
        {
            playbackSpeed        = newSpeed;
            player.playbackSpeed = playbackSpeed;
        }
        textureOutputKnob.DisplayLayout();
        GUILayout.EndVertical();

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #15
0
        public override void NodeGUI()
        {
            if (triggers == null)
            {
                triggers = new List <TriggerMapping>();
            }

            if (dynamicConnectionPorts.Count != triggers.Count)
            { // Make sure labels and ports are synchronised
                while (dynamicConnectionPorts.Count > triggers.Count)
                {
                    DeleteConnectionPort(dynamicConnectionPorts.Count - 1);
                }
                while (dynamicConnectionPorts.Count < triggers.Count)
                {
                    CreateValueConnectionKnob(dynaCreationAttribute);
                }
            }

            GUILayout.Label("This is a timeline node");

            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal();
            inputKnob.DisplayLayout();
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();

            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal();
            currentTrack = EditorGUILayout.ObjectField("timeline clip", currentTrack, typeof(PlayableDirector), true) as PlayableDirector;
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();

            if (GUILayout.Button("Add", GUILayout.ExpandWidth(false)))
            {
                triggers.Add(new TriggerMapping());
                CreateValueConnectionKnob(dynaCreationAttribute);
            }

            for (int i = 0; i < triggers.Count; i++)
            { // Display label and delete button
                GUILayout.BeginHorizontal();
                GUILayout.Label("trigger " + i);
                ((ValueConnectionKnob)dynamicConnectionPorts[i]).SetPosition();
                if (GUILayout.Button("x", GUILayout.ExpandWidth(false)))
                { // Remove current label
                    triggers.RemoveAt(i);
                    DeleteConnectionPort(i);
                    i--;
                }
                GUILayout.EndHorizontal();

                TriggerMapping curTrigger = triggers[i];
                curTrigger.trigger = EditorGUILayout.ObjectField("timeline clip", curTrigger.trigger, typeof(TimelineTrigger), true) as TimelineTrigger;
                curTrigger.type    = (TriggerType)EditorGUILayout.EnumPopup("trigger type", curTrigger.type);
                triggers[i]        = curTrigger;
                GUILayout.Space(10);
            }
        }
Example #16
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();
        inputSignalKnob.DisplayLayout();
        GUILayout.BeginHorizontal();
        recordControlKnob.DisplayLayout();
        // Start state: neither recorded nor recording
        if (!clipRecorded && !clipRecording)
        {
            // Display start recording button
            if (GUILayout.Button("Start recording"))
            {
                StartRecording();
            }
        }
        else
        {
            // Second state: recording input
            if (clipRecording)
            {
                // Display end recording button
                if (GUILayout.Button("Finish"))
                {
                    FinishRecording();
                }
            }
            // Third state: recording is finished
            else
            {
                // Display Start/stop button
                string label = clipPlaying ? "Stop" : "Start";
                if (GUILayout.Button(label))
                {
                    TogglePlayback();
                }
            }
        }
        GUILayout.EndHorizontal();

        frequencyModulationKnob.DisplayLayout();
        if (!frequencyModulationKnob.connected())
        {
            frequencyModulation = RTEditorGUI.Slider(frequencyModulation, 0, 1);
        }

        if (clipRecorded)
        {
            if (GUILayout.Button("Reset"))
            {
                ResetRecording();
            }
        }

        GUILayout.EndVertical();
        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #17
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();

        GUILayout.BeginHorizontal(GUILayout.MaxHeight(40));
        //GUILayout.Label(new GUIContent("Turbulence factor", "The offset of the normal angle per point"));
        turbIntensityKnob.DisplayLayout();
        if (!turbIntensityKnob.connected())
        {
            turbFactor = RTEditorGUI.Slider(turbFactor, 0, 1, options: GUILayout.MaxWidth(120));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal(GUILayout.MaxHeight(40));
        turbScaleKnob.DisplayLayout();
        //GUILayout.Label(new GUIContent("Turbulence scale", "The offset of the normal angle per point"));
        if (!turbScaleKnob.connected())
        {
            turbScale = RTEditorGUI.Slider(turbScale, 2, 64, options: GUILayout.MaxWidth(120));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal(GUILayout.MaxHeight(40));
        tinselThicknessKnob.DisplayLayout();
        if (!tinselThicknessKnob.connected())
        {
            tinselThickness = RTEditorGUI.Slider(tinselThickness, 1, 32, options: GUILayout.MaxWidth(120));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal(GUILayout.MaxHeight(40));
        tinselAmplitudeKnob.DisplayLayout();
        if (!tinselAmplitudeKnob.connected())
        {
            tinselAmplitude = RTEditorGUI.Slider(tinselAmplitude, 2, 32, options: GUILayout.MaxWidth(120));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal(GUILayout.MaxHeight(40));
        tinselOffsetKnob.DisplayLayout();
        if (!tinselOffsetKnob.connected())
        {
            tinselOffset = RTEditorGUI.Slider(tinselOffset, 0, 128, options: GUILayout.MaxWidth(120));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal(GUILayout.MaxHeight(40));
        GUILayout.Box(noiseTex, GUILayout.MaxHeight(100));
        GUILayout.Box(treeTex, GUILayout.MaxHeight(100));
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #18
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);
 }
Example #19
0
        protected bool EventKnobOrButton(string label, ValueConnectionKnob knob)
        {
            GUILayout.BeginHorizontal();
            knob.DisplayLayout();
            bool val = knob.connected() ? GUILayout.Button(label) || knob.GetValue <bool>() : GUILayout.Button(label);

            GUILayout.EndHorizontal();
            return(val);
        }
Example #20
0
 public override void NodeGUI()
 {
     inputKnob.DisplayLayout(new GUIContent("Texture" + (tex != null ? ":" : " (null)"), "The texture to display information about."));
     if (tex != null)
     {
         RTTextureViz.DrawTexture(tex, 64);
         GUILayout.Label("'" + tex.name + "'");
         GUILayout.Label("Size: " + tex.width + "x" + tex.height + "");
     }
 }
Example #21
0
 public override void NodeGUI()
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label(string.Format("Value: {0:0.00}", outputSignal));
     outputSignalKnob.DisplayLayout();
     GUILayout.EndVertical();
     if (GUI.changed)
     {
         NodeEditor.curNodeCanvas.OnNodeChange(this);
     }
 }
        public override void NodeGUI()
        {
            inputKnob.DisplayLayout();

            _textureName = RTEditorGUI.TextField(new GUIContent("Texture name"), _textureName);

            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        }
Example #23
0
        public override void NodeGUI()
        {
            outputKnob.DisplayLayout();

            RTEditorGUIExtensions.ReadOnlyTextField("Value", _value.ToString());

            if (GUILayout.Button("Regenerate"))
            {
                Regenerate();
            }
        }
Example #24
0
        public override void NodeGUI()
        {
            outputKnob.DisplayLayout();

            _value = RTEditorGUI.FloatField(new GUIContent("Constant value"), _value);

            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        }
Example #25
0
        public override void NodeGUI()
        {
            outputKnob.DisplayLayout();

            _frequency = RTEditorGUI.FloatField(new GUIContent("Frequency"), _frequency);

            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        }
Example #26
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();

        if (!bound && !binding)
        {
            if (GUILayout.Button("Bind stick"))
            {
                binding = true;
            }
        }
        else
        {
            if (bound)
            {
                if (GUILayout.Button("Unbind"))
                {
                    bound = false;
                }

                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.Label(string.Format("<{0:0.00},{1:0.00}>", axis2D.x, axis2D.y));
                axis2DKnob.DisplayLayout();
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.Label(string.Format("{0:0.00}", axis2D.x));
                axisXKnob.DisplayLayout();
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.Label(string.Format("{0:0.00}", axis2D.y));
                axisYKnob.DisplayLayout();
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.Label("Use thumbstick to bind");
            }
        }


        GUILayout.Space(4);

        GUILayout.EndVertical();
        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #27
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();
        aKnob.DisplayLayout();
        if (!aKnob.connected())
        {
            a = RTEditorGUI.Slider(a, 0.1f, 100);
        }
        bKnob.DisplayLayout();
        if (!bKnob.connected())
        {
            b = RTEditorGUI.Slider(b, 0.1f, 100);
        }
        m1Knob.DisplayLayout();
        if (!m1Knob.connected())
        {
            m1 = RTEditorGUI.Slider(m1, 0, 100);
        }
        m2Knob.DisplayLayout();
        if (!m2Knob.connected())
        {
            m2 = RTEditorGUI.Slider(m2, 0, 100);
        }
        n1Knob.DisplayLayout();
        if (!n1Knob.connected())
        {
            n1 = RTEditorGUI.Slider(n1, 0, 100);
        }
        n2Knob.DisplayLayout();
        if (!n2Knob.connected())
        {
            n2 = RTEditorGUI.Slider(n2, 0, 100);
        }
        n3Knob.DisplayLayout();
        if (!n3Knob.connected())
        {
            n3 = RTEditorGUI.Slider(n3, 0, 100);
        }

        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Box(outputTex, GUILayout.MaxWidth(64), GUILayout.MaxHeight(64));
        GUILayout.EndHorizontal();
        GUILayout.Space(4);
        GUILayout.EndVertical();
        outputTexKnob.SetPosition(236);
        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Example #28
0
 protected void IntKnobOrSlider(ref int val, int min, int max, ValueConnectionKnob knob, params GUILayoutOption[] layoutOpts)
 {
     GUILayout.BeginHorizontal();
     knob.DisplayLayout();
     if (!knob.connected())
     {
         val = RTEditorGUI.IntSlider(val, min, max, layoutOpts);
     }
     else
     {
         val = knob.GetValue <int>();
     }
     GUILayout.EndHorizontal();
 }
Example #29
0
        public override void NodeGUI()
        {
            outputKnob.DisplayLayout();

            _frequency    = RTEditorGUI.FloatField(new GUIContent("Frequency"), _frequency);
            _displacement = RTEditorGUI.FloatField(new GUIContent("Lacunarity"), _displacement);
            _seed         = RTEditorGUI.IntField(new GUIContent("Seed"), _seed);
            _distance     = RTEditorGUI.Toggle(_distance, new GUIContent("Distance"));

            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
        }
        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);
            }
        }