Ejemplo n.º 1
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);
        }
    }
Ejemplo n.º 2
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);
     }
 }
        /// <summary>
        /// Generates all the styles for this node group based of the color
        /// </summary>
        private void GenerateStyles()
        {
            // Transparent background
            Texture2D background = RTEditorGUI.ColorToTex(8, _color * new Color(1, 1, 1, 0.4f));
            // lighter, less transparent background
            Texture2D altBackground = RTEditorGUI.ColorToTex(8, _color * new Color(1, 1, 1, 0.6f));
            // nearly opaque background
            Texture2D opBackground = RTEditorGUI.ColorToTex(8, _color * new Color(1, 1, 1, 0.9f));

            backgroundStyle = new GUIStyle();
            backgroundStyle.normal.background = background;
            backgroundStyle.padding           = new RectOffset(10, 10, 5, 5);

            altBackgroundStyle = new GUIStyle();
            altBackgroundStyle.normal.background = altBackground;
            altBackgroundStyle.padding           = new RectOffset(10, 10, 5, 5);

            opBackgroundStyle = new GUIStyle();
            opBackgroundStyle.normal.background = opBackground;
            opBackgroundStyle.padding           = new RectOffset(10, 10, 5, 5);

//			dragHandleStyle = new GUIStyle ();
//			dragHandleStyle.normal.background = background;
//			//dragHandleStyle.hover.background = altBackground;
//			dragHandleStyle.padding = new RectOffset (10, 10, 5, 5);

            headerTitleStyle                  = new GUIStyle();
            headerTitleStyle.fontSize         = 20;
            headerTitleStyle.normal.textColor = Color.white;

            headerTitleEditStyle = new GUIStyle(headerTitleStyle);
            headerTitleEditStyle.normal.background  = background;
            headerTitleEditStyle.focused.background = background;
            headerTitleEditStyle.focused.textColor  = Color.white;
        }
Ejemplo 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();
        }
Ejemplo n.º 5
0
    public override void NodeGUI()
    {
        base.NodeGUI();
        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();

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

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

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Ejemplo n.º 6
0
        public override void NodeGUI()
        {
            GUILayout.Label("WARNING: this node is deprecated and will later be deleted. Use a Condition Group Node with a Time Trigger.");
            GUILayout.BeginVertical(GUILayout.MinWidth(300f));
            for (int i = 0; i < times.Count; i++)
            {
                RTEditorGUI.Seperator();
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("x", GUILayout.ExpandWidth(false)))
                {
                    DeleteConnectionPort(outputKnobs[i + 1]);
                    times.RemoveAt(i);
                    i--;
                    continue;
                }

                GUILayout.Label("Event " + i);
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                times[i] = RTEditorGUI.IntField("Time:", times[i]);
                outputKnobs[i + 1].DisplayLayout();
                GUILayout.EndHorizontal();
            }

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add", GUILayout.ExpandWidth(false), GUILayout.MinWidth(100f)))
            {
                CreateConnectionKnob(outputAttribute);
                times.Add(times.Count);
            }

            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }
Ejemplo n.º 7
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);
        }
    }
 public static bool Init(bool GUIFunction)
 {
     Background      = ResourceManager.LoadTexture("Textures/background.png");
     AALineTex       = ResourceManager.LoadTexture("Textures/AALine.png");
     GUIBox          = ResourceManager.LoadTexture("Textures/NE_Box.png");
     GUIButton       = ResourceManager.LoadTexture("Textures/NE_Button.png");
     GUIBoxSelection = ResourceManager.LoadTexture("Textures/BoxSelection.png");
     if (!(bool)Background || !(bool)AALineTex || !(bool)GUIBox || !(bool)GUIButton)
     {
         return(false);
     }
     if (!GUIFunction)
     {
         return(true);
     }
     nodeSkin = Object.Instantiate(GUI.skin);
     nodeSkin.label.normal.textColor = NE_TextColor;
     nodeLabel = nodeSkin.label;
     nodeSkin.box.normal.textColor  = NE_TextColor;
     nodeSkin.box.normal.background = GUIBox;
     nodeBox = nodeSkin.box;
     nodeSkin.button.normal.textColor    = NE_TextColor;
     nodeSkin.button.normal.background   = GUIButton;
     nodeSkin.textArea.normal.background = GUIBox;
     nodeSkin.textArea.active.background = GUIBox;
     nodeLabelBold                       = new GUIStyle(nodeLabel);
     nodeLabelBold.fontStyle             = FontStyle.Bold;
     nodeLabelSelected                   = new GUIStyle(nodeLabel);
     nodeLabelSelected.normal.background = RTEditorGUI.ColorToTex(1, NE_LightColor);
     nodeBoxBold           = new GUIStyle(nodeBox);
     nodeBoxBold.fontStyle = FontStyle.Bold;
     return(true);
 }
Ejemplo n.º 9
0
    public override void NodeGUI()
    {
        GUILayout.BeginVertical();

        GUILayout.BeginHorizontal();
        ip = RTEditorGUI.TextField(new GUIContent("IP"), ip);
        if (GUILayout.Button("Set IP"))
        {
            controller.remoteIP = ip;
        }
        var label = running ? "Stop" : "Start";

        if (GUILayout.Button(label))
        {
            running = !running;
        }
        if (GUILayout.Button("Reset"))
        {
            index = 0;
        }
        GUILayout.EndHorizontal();

        litTime = RTEditorGUI.Slider("Lit time", litTime, 0.1f, 2f);
        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.Space(4);

        if (GUI.changed)
        {
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Ejemplo n.º 10
0
 protected void ReloadKnobTexture()
 {
     ReloadTexture();
     if ((UnityEngine.Object)knobTexture == (UnityEngine.Object)null)
     {
         throw new UnityException("Knob texture of " + base.name + " could not be loaded!");
     }
     if (side != defaultSide)
     {
         ResourceManager.SetDefaultResourcePath(NodeEditor.editorPath + "Resources/");
         int rotationStepsAntiCW = getRotationStepsAntiCW(defaultSide, side);
         ResourceManager.MemoryTexture memoryTexture = ResourceManager.FindInMemory(knobTexture);
         if (memoryTexture != null)
         {
             string[] array = new string[memoryTexture.modifications.Length + 1];
             memoryTexture.modifications.CopyTo(array, 0);
             array[array.Length - 1] = "Rotation:" + rotationStepsAntiCW;
             Texture2D texture = ResourceManager.GetTexture(memoryTexture.path, array);
             if ((UnityEngine.Object)texture != (UnityEngine.Object)null)
             {
                 knobTexture = texture;
             }
             else
             {
                 knobTexture = RTEditorGUI.RotateTextureCCW(knobTexture, rotationStepsAntiCW);
                 ResourceManager.AddTextureToMemory(memoryTexture.path, knobTexture, array.ToArray());
             }
         }
         else
         {
             knobTexture = RTEditorGUI.RotateTextureCCW(knobTexture, rotationStepsAntiCW);
         }
     }
 }
Ejemplo n.º 11
0
    public override void NodeGUI()
    {
        base.NodeGUI();

        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();
        GUILayout.Label("octaves:");
        GUILayout.Label("frequency:");
        GUILayout.Label("amplitude:");
        GUILayout.EndVertical();
        GUILayout.BeginVertical();
        octaves   = RTEditorGUI.IntField(octaves);
        frequency = RTEditorGUI.FloatField(frequency);
        amplitude = RTEditorGUI.FloatField(amplitude);
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();


        noiseFunction = noiseGUI.Display();

        if (GUI.changed || noiseGUI.changed)
        {
            fractalNoise = new FractalNoise(noiseFunction, octaves, frequency, amplitude);
            noiseDesc    = noiseGUI.noiseDesc();
            NodeEditor.curNodeCanvas.OnNodeChange(this);
        }
    }
Ejemplo n.º 12
0
    static void DrawFSMlist(float width, float height)
    {
        ActionMenuTools      tools = ActionMenuTools.GetInstance();
        HashSet <NodeCanvas> clist = new HashSet <NodeCanvas>(tools.Loadedcanvases);

        NodeCanvas currentcanvas = NodeEditorInterface.GetInstance().canvasCache.nodeCanvas;

        GUILayout.Label(new GUIContent("Current load Canvas Cnt " + clist.Count));
        if (GUILayout.Button("Reload FSM"))
        {
            LoadFSM();
        }

        int i = 0;

        foreach (NodeCanvas loaded in clist)
        {
            if (loaded != null)
            {
                RTEditorGUI.Toggle(currentcanvas != null && currentcanvas == loaded, new GUIContent("[" + i + "]"));
                UnityEditor.EditorGUILayout.ObjectField(loaded, typeof(NodeCanvas), false);
                if (GUILayout.Button("load"))
                {
                    NodeEditorInterface.GetInstance().canvasCache.LoadNodeCanvas(loaded, false);
                }

                i++;
            }
        }
    }
Ejemplo n.º 13
0
        //int selectedidx = 0;
        public override void NodeGUI()
        {
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical();

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

            EditorGUILayout.LabelField("Control");

            Assembly ta = typeof(BT.BTComposite).Assembly;

            var ts =
                ta.GetTypes().Where(t =>
                                    t.BaseType != null && t.BaseType == typeof(BT.BTComposite)
                                    );

            Type[]   tst    = ts.ToArray();
            string[] tsname = new string[tst.Length];
            for (int i = 0; i < tst.Length; ++i)
            {
                tsname[i] = tst[i].FullName;
            }

            m_SelectIdx = RTEditorGUI.Popup(m_SelectIdx, tsname);

            for (int i = 0; i < tst[i].GetFields().Count(); ++i)
            {
                if (tst[i].GetFields()[i].GetType() == typeof(int))
                {
                    //        EditorGUILayout.IntField(tst[i].GetFields()[i].Name);
                }
            }
        }
Ejemplo n.º 14
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);
        }
    }
Ejemplo n.º 15
0
 public override void NodeGUI()
 {
     output.DisplayLayout();
     GUILayout.Label("Sector name");
     sectorName = RTEditorGUI.TextField(sectorName);
     loseMode   = RTEditorGUI.Toggle(loseMode, "Check for loss instead of win?");
 }
Ejemplo n.º 16
0
        public override void NodeGUI()
        {
            GUILayout.BeginHorizontal();
            input.DisplayLayout();
            output.DisplayLayout();
            GUILayout.EndHorizontal();

            if (!(endPanning = GUILayout.Toggle(endPanning, "End Panning")))
            {
                if (useCoordinates = Utilities.RTEditorGUI.Toggle(useCoordinates, "Use coordinates"))
                {
                    GUILayout.Label("Coordinates:");
                    float x = coordinates.x, y = coordinates.y;
                    GUILayout.BeginHorizontal();
                    x           = Utilities.RTEditorGUI.FloatField("X", x);
                    y           = Utilities.RTEditorGUI.FloatField("Y", y);
                    coordinates = new Vector2(x, y);
                    GUILayout.EndHorizontal();
                }
                else
                {
                    GUILayout.Label("Flag Name:");
                    flagName = GUILayout.TextField(flagName);
                }

                velocityFactor = Utilities.RTEditorGUI.FloatField("Velocity Factor", velocityFactor);
                asynchronous   = RTEditorGUI.Toggle(asynchronous, "Asynchronous Mode", GUILayout.MinWidth(400));
            }
        }
Ejemplo n.º 17
0
    public override void NodeGUI()
    {
        inputTexKnob.SetPosition(20);
        GUILayout.BeginVertical();

        GUILayout.BeginHorizontal();
        ip = RTEditorGUI.TextField(new GUIContent("IP"), ip);
        if (GUILayout.Button("Set IP"))
        {
            controller.remoteIP = ip;
        }
        GUILayout.EndHorizontal();

        mirrorOffset = RTEditorGUI.IntSlider(mirrorOffset, 0, 95);

        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.Space(4);
        GUILayout.EndVertical();
        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();
        }
Ejemplo n.º 19
0
        public override void DrawNodePropertyEditor()
        {
            m_ExportAnimatedAsSingleSpriteSheet = RTEditorGUI.Toggle(m_ExportAnimatedAsSingleSpriteSheet, "Export as Sprite Sheet");
            if (GUILayout.Button("save png"))
            {
                string name = Path.GetFileName(ms_PathName);
                ms_PathName = EditorUtility.SaveFilePanel("SavePNG", Path.GetDirectoryName(ms_PathName), name, "png");
                Debug.Log(" path " + ms_PathName);

                SavePNG(m_Output, ms_PathName, true);
            }
            //miked        m_TitleBoxColor = Color.green;
#if UNITY_EDITOR
            m_TexName = (string)GUILayout.TextField(m_TexName);
            m_Output  = (Texture2D)EditorGUILayout.ObjectField(m_Output, typeof(Texture2D), false, GUILayout.MinHeight(200), GUILayout.MinHeight(200));
            //GUILayout.EndArea();
#endif

            /*
             *      GUILayout.BeginArea(new Rect(0, 40, 150, 256));
             *      if (m_Cached != null)
             *      {
             *          GUILayout.Label(m_Cached);
             *      }
             *      GUILayout.EndArea();
             */
        }
Ejemplo n.º 20
0
        protected void ReloadKnobTexture()
        {
            ReloadType();

            if (side != defaultSide)
            {             // Rotate Knob texture according to the side it's used on
                int rotationSteps = getRotationStepsAntiCW(defaultSide, side);

                ResourceManager.MemoryTexture memoryTex = ResourceManager.FindInMemory(knobTexture);
                List <string> mods = memoryTex.modifications.ToList();
                mods.Add("Rotation:" + rotationSteps);

                Texture2D knobTextureInMemory = ResourceManager.GetTexture(texturePath, mods.ToArray());

                if (knobTextureInMemory != null)
                {
                    knobTexture = knobTextureInMemory;
                }
                else
                {
                    knobTexture = RTEditorGUI.RotateTextureAntiCW(knobTexture, rotationSteps);
                    ResourceManager.AddTexture(texturePath, knobTexture, mods.ToArray());
                }
            }
        }
Ejemplo n.º 21
0
        //[ConnectionKnob("Input Left", Direction.In, "TaskFlow", NodeSide.Left, 20)]
        //public ConnectionKnob inputLeft;

        //[ConnectionKnob("Output Right", Direction.Out, "TaskFlow", NodeSide.Right, 20)]
        //public ConnectionKnob outputRight;

        public override void NodeGUI()
        {
            if (input == null)
            {
                if (inputKnobs.Count > 0)
                {
                    input  = inputKnobs[0];
                    output = outputKnobs[0];
                }
                else if (Canvas is DialogueCanvas)
                {
                    input  = CreateConnectionKnob(dialogueIn);
                    output = CreateConnectionKnob(dialogueOut);
                }
                else
                {
                    input  = CreateConnectionKnob(flowIn);
                    output = CreateConnectionKnob(flowOut);
                }
            }

            {
                GUILayout.BeginHorizontal();
                inputKnobs[0].DisplayLayout();
                outputKnobs[0].DisplayLayout();
                GUILayout.EndHorizontal();
            }

            GUILayout.Label("Variable Name:");
            variableName = GUILayout.TextField(variableName);
            GUILayout.Label("Value:");
            value         = RTEditorGUI.IntField(value);
            incrementMode = GUILayout.Toggle(incrementMode, "Increment mode: ");
        }
Ejemplo n.º 22
0
        public override void NodeGUI()
        {
            height = 180f;
            GUILayout.Label("Reward giver ID:");
            rewardGiverID = GUILayout.TextField(rewardGiverID, GUILayout.Width(200f));
            if (WorldCreatorCursor.instance != null)
            {
                if (GUILayout.Button("Select", GUILayout.ExpandWidth(false)))
                {
                    WorldCreatorCursor.selectEntity += SetEntityID;
                    WorldCreatorCursor.instance.EntitySelection();
                }
            }
            GUILayout.Label("Reward text:");
            rewardText = GUILayout.TextArea(rewardText, GUILayout.ExpandHeight(false), GUILayout.Width(200f));
            height    += GUI.skin.textArea.CalcHeight(new GUIContent(rewardText), 200f);
            GUILayout.Label("Text Color:");
            float r, g, b;

            GUILayout.BeginHorizontal();
            r = RTEditorGUI.FloatField(textColor.r);
            g = RTEditorGUI.FloatField(textColor.g);
            b = RTEditorGUI.FloatField(textColor.b);
            GUILayout.EndHorizontal();
            textColor = new Color(r, g, b);
        }
Ejemplo n.º 23
0
    protected internal override void InspectorNodeGUI()
    {
        m_OffsetX = RTEditorGUI.Slider(m_OffsetX, -1000.0f, 1000.0f); //,new GUIContent("Red", "Float"), m_R);
        m_OffsetY = RTEditorGUI.Slider(m_OffsetY, -1000.0f, 1000.0f); //,new GUIContent("Red", "Float"), m_R);
        m_ScaleX  = RTEditorGUI.Slider(m_ScaleX, 0.0f, 1000.0f);      //,new GUIContent("Red", "Float"), m_R);
        m_ScaleY  = RTEditorGUI.Slider(m_ScaleY, 0.0f, 1000.0f);      //,new GUIContent("Red", "Float"), m_R);

        m_Noise = RTEditorGUI.Slider(m_Noise, 0.0f, 1000.0f);         //,new GUIContent("Red", "Float"), m_R);

        m_Octaves = RTEditorGUI.IntSlider(m_Octaves, 0, 10);          //,new GUIContent("Red", "Float"), m_R);

        if (m_Cached != null)
        {
            GUILayout.Label(m_Cached);
        }

/*
 *      GUILayout.Label ("This is a custom Node!");
 *
 *              GUILayout.BeginHorizontal ();
 *              GUILayout.BeginVertical ();
 *
 *
 *
 *              GUILayout.EndVertical ();
 *              GUILayout.BeginVertical ();
 *
 *              Outputs [0].DisplayLayout ();
 *
 *              GUILayout.EndVertical ();
 *              GUILayout.EndHorizontal ();
 *
 */
    }
Ejemplo n.º 24
0
 protected override void NodeGUI()
 {
     using (var hscope = new GUILayout.HorizontalScope())
     {
         clip = RTEditorGUI.ObjectField <AnimationClip>("Animation Clip", clip, true);
     }
 }
Ejemplo n.º 25
0
        /// <summary>
        /// Requests to reload the knobTexture and adapts it to the position and orientation
        /// </summary>
        protected void UpdateKnobTexture()
        {
            ReloadTexture();
            if (knobTexture == null)
            {
                throw new UnityException("Knob texture of " + name + " could not be loaded!");
            }
            if (side != defaultSide)
            {             // Rotate Knob texture according to the side it's used on
                int       rotationSteps = getRotationStepsAntiCW(defaultSide, side);
                string[]  mods          = new string[] { "Rotation:" + rotationSteps };
                Texture2D modKnobTex    = null;

                // Try to get standard texture in memory
                ResourceManager.MemoryTexture memoryTex = ResourceManager.FindInMemory(knobTexture);
                if (memoryTex != null)
                {                 // Texture does exist in memory, so built a mod including rotation and try to find it again
                    mods = ResourceManager.AppendMod(memoryTex.modifications, "Rotation:" + rotationSteps);
                    ResourceManager.TryGetTexture(memoryTex.path, ref modKnobTex, mods);
                }

                if (modKnobTex == null)
                {                 // Rotated version does not exist yet, so create and record it
                    modKnobTex = RTEditorGUI.RotateTextureCCW(knobTexture, rotationSteps);
                    ResourceManager.AddTextureToMemory(memoryTex.path, modKnobTex, mods);
                }

                knobTexture = modKnobTex;
            }
        }
Ejemplo n.º 26
0
        public override void NodeGUI()
        {
            if (input == null)
            {
                if (inputKnobs.Count > 0)
                {
                    input  = inputKnobs[0];
                    output = outputKnobs[0];
                }
                else if (Canvas is DialogueCanvas)
                {
                    input  = CreateConnectionKnob(dialogueIn);
                    output = CreateConnectionKnob(dialogueOut);
                }
                else
                {
                    input  = CreateConnectionKnob(flowIn);
                    output = CreateConnectionKnob(flowOut);
                }
            }

            {
                GUILayout.BeginHorizontal();
                inputKnobs[0].DisplayLayout();
                outputKnobs[0].DisplayLayout();
                GUILayout.EndHorizontal();
            }

            GUILayout.Label("Faction Number");
            factionID = RTEditorGUI.IntField(factionID);
            GUILayout.Label("Relations sum:");
            relationsSum = RTEditorGUI.IntField(relationsSum);
        }
Ejemplo n.º 27
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);
        }
    }
Ejemplo n.º 28
0
        public sealed override void NodeGUI()
        {
#if UNITY_EDITOR
            bool running = this.isRunning;
            if (running)
            {
                this.backgroundColor = Color.green;
            }
            else
            {
                this.backgroundColor = Color.white;
            }

            GUILayout.BeginHorizontal();
            Priority = RTEditorGUI.IntField(new GUIContent("Priority:", "state excute order "), Priority);
            GUILayout.Toggle(running, new GUIContent("Running state:", "if it is the fsm current state"));
            GUILayout.EndHorizontal();
#if UNITY_EDITOR
            TestForNext = GUILayout.Toggle(TestForNext, new GUIContent("To Next", "Just for Test"));
#endif

            DrawFSMGUI();
            if (GUI.changed)
            {
                NodeEditor.curNodeCanvas.OnNodeChange(this);
            }
#endif
        }
Ejemplo n.º 29
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);
            }
        }
Ejemplo n.º 30
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);
        }
    }