Example #1
0
    void OnGUI()
    {
        // Is all in order with the Archimatix install?
        if (string.IsNullOrEmpty(ArchimatixEngine.pathChangelog) || string.IsNullOrEmpty(changelogText))
        {
            return;
        }

        if (richLabelStyle == null)
        {
            richLabelStyle           = new GUIStyle(GUI.skin.label);
            richLabelStyle.richText  = true;
            richLabelStyle.wordWrap  = true;
            richButtonStyle          = new GUIStyle(GUI.skin.button);
            richButtonStyle.richText = true;

            textLabelStyle            = new GUIStyle(GUI.skin.label);
            textLabelStyle.richText   = true;
            textLabelStyle.wordWrap   = true;
            textLabelStyle.alignment  = TextAnchor.MiddleLeft;
            textLabelStyle.fixedWidth = 510;

            iconButtonStyle = new GUIStyle(GUI.skin.button);
            iconButtonStyle.normal.background = null;
            iconButtonStyle.imagePosition     = ImagePosition.ImageOnly;
            iconButtonStyle.fixedWidth        = 128;
            iconButtonStyle.fixedHeight       = 128;
        }

        Rect headerRect = new Rect(0, 0, 530, 200);

        EditorGUI.DrawTextureTransparent(headerRect, headerPic, ScaleMode.StretchToFill);


        GUILayout.Space(200);

        GUILayout.BeginVertical();
        {
            // What to do next....
            horizontalRule(0, 2);

            /*
             * GUILayout.BeginHorizontal();
             * GUILayout.FlexibleSpace();
             * GUILayout.Label ("Version " +ArchimatixEngine.version, richLabelStyle);
             * GUILayout.FlexibleSpace();
             * GUILayout.EndHorizontal();
             */


            // TOP BUTTONS

            GUILayout.BeginHorizontal();

            GUILayout.Space(5);


            // User GUIDE
            if (GUILayout.Button("<b>User Guide </b>\n<size=12>The best way to get started</size>", richButtonStyle, GUILayout.MaxWidth(400), GUILayout.Height(36)))
            {
                string file = "file:///" + Application.dataPath + "/Archimatix/Documentation/UserGuide.pdf";
                Application.OpenURL(file);
            }



            // TUTORIALS
            if (GUILayout.Button("<b>Tutorial Videos </b>\n<size=12>Watch a range of how-tos</size>", richButtonStyle, GUILayout.MaxWidth(400), GUILayout.Height(36)))
            {
                Application.OpenURL("http://www.archimatix.com/tutorials");
            }

            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            GUILayout.Space(4);

            GUILayout.Label("Or, click on one of these to jump right in!", textLabelStyle, new GUILayoutOption[] { GUILayout.MinWidth(450) });

            GUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();

                if (GUILayout.Button(icon3DLibrary, iconButtonStyle))
                {
                    ArchimatixEngine.openLibrary3D();
                }


                if (GUILayout.Button(icon2DLibrary, iconButtonStyle))
                {
                    ArchimatixEngine.openLibrary2D();
                }


                //if (ArchimatixEngine.NodeGraphEditorIsInstalled)
                //{

                if (GUILayout.Button(iconAXEditor, iconButtonStyle))
                {
                    AXNodeGraphEditorWindow.Init();
                }


                //}


                GUILayout.FlexibleSpace();
            }
            GUILayout.EndHorizontal();
        }



        horizontalRule(4, 1);



        // CHANGE_LOG

        GUILayout.BeginHorizontal();
        changelogScroll = GUILayout.BeginScrollView(changelogScroll, GUIStyle.none, new GUIStyle(GUI.skin.verticalScrollbar));
        GUILayout.Label(changelogText, textLabelStyle);
        GUILayout.EndScrollView();
        GUILayout.EndHorizontal();



        horizontalRule(0, 4);


        GUILayout.BeginHorizontal();
        {
            showAcknowledgements = EditorGUILayout.Foldout(showAcknowledgements, "Acknowledgments", true);

            if (showAcknowledgements)
            {
                GUILayout.BeginHorizontal();
                {
                    GUILayout.TextArea("Special thanks to Unity community members in the Beta Team: @elbows, @S_Darkwell, @HeliosDoubleSix, @Teila, @wetcircuit, @radimoto @puzzlekings, @mangax, @sarum, @Sheriziya, @Voronoi, @steveR, @manpower13, @vrpostcard, @Whippets, @pixelstream, @Damien-Delmarle, @recursive, @sloopidoopi, @KWaldt, @pcg, @Hitch42, @Bitstream, @CognitiveCode, @ddutchie, @JacooGamer, @razmot, @angrypenguin, @Paylo, @AdamGoodrich. Also, for much needed feedback and support, many thanks to Eden Muir, Andrew Cortese, Lucas Meijer, Sanjay Mistry, Dominic Laflamme, Rune Skovbo, Alan Robles, Luke Noonan, Anton Hand, Lucas Miller, and Joachim Holmér");
                }
                GUILayout.EndHorizontal();
            }
        }
        GUILayout.EndHorizontal();
        // BOTTOM BUTTON - DOCUMENTATION

        GUILayout.BeginHorizontal();
        {
            if (GUILayout.Button("<b>Documentation</b>\n<size=12>Manual, examples and tips</size>", richButtonStyle, GUILayout.MaxWidth(260), GUILayout.Height(36)))
            {
                Application.OpenURL("http://archimatix.com/documentation");
            }

            if (GUILayout.Button("<b>Rate it</b>\n<size=12>on the Asset Store</size>", richButtonStyle, GUILayout.Height(36)))
            {
                Application.OpenURL("http://u3d.as/qYW");
                //Application.OpenURL("com.unity3d.kharma:content/?");
            }
            if (GUILayout.Button("<b>Join the Community!</b>\n<size=12>We're are building worlds.</size>", richButtonStyle, GUILayout.Height(36)))
            {
                Application.OpenURL("http://community.archimatix.com");
                //Application.OpenURL("com.unity3d.kharma:content/?");
            }
        }
        GUILayout.EndHorizontal();



        // Contact
        horizontalRule(4, 2);

        GUILayout.BeginHorizontal();
        {
            if (GUILayout.Button("<b>E-mail</b>\n<size=12>[email protected]</size>", richButtonStyle, GUILayout.MaxWidth(172), GUILayout.Height(36)))
            {
                Application.OpenURL("mailto:[email protected]");
            }

            if (GUILayout.Button("<b>Twitter</b>\n<size=12>@archimatix</size>", richButtonStyle, GUILayout.Height(36)))
            {
                Application.OpenURL("http://twitter.com/archimatix");
            }

            // UNITY FORUM
            if (GUILayout.Button("<b>Unity Forum</b>\n<size=12>The Original!</size>", richButtonStyle, GUILayout.MaxWidth(172), GUILayout.Height(36)))
            {
                Application.OpenURL("http://bit.ly/2gj4oax");
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.Space(5);

        GUILayout.EndVertical();
    }
Example #2
0
    public override void OnInspectorGUI()
    {
        //if (Event.current.type != EventType.Layout)
        //	return;
        AXModel model = (AXModel)target;


        Event e = Event.current;

        //GUI.skin = axskin;
        //GUI.skin = null;

        //Debug.Log(evt.type);
        switch (e.type)
        {
        case EventType.Layout:
            if (doAutobuild)
            {
                doAutobuild = false;
                //model.autobuild ();
                ArchimatixEngine.scheduleBuild();
            }
            break;


        case EventType.MouseDown:
            //Debug.Log("Down");

            break;

        case EventType.MouseUp:

            //doAutobuild = true;
            break;

        case EventType.KeyUp:

            if (e.keyCode == KeyCode.Return || e.keyCode == KeyCode.KeypadEnter)
            {
                Undo.RegisterCompleteObjectUndo(model, "Enter");
                doAutobuild = true;
            }
            //Debug.Log("KeyUp");
            //doAutobuild = true;
            break;

        case EventType.DragUpdated:
            UnityEngine.Debug.Log("Dragging");
            break;

        case EventType.DragPerform:
            //DragAndDrop.AcceptDrag();
            UnityEngine.Debug.Log("Drag and Drop not supported... yet");
            Undo.RegisterCompleteObjectUndo(model, "Default material scale");

            doAutobuild = true;
            break;
        }



        if (richLabelStyle == null)
        {
            richLabelStyle          = new GUIStyle(GUI.skin.label);
            richLabelStyle.richText = true;
            richLabelStyle.wordWrap = true;
        }
        //if (infoIconTexture = null)


        String rubricColor = (EditorGUIUtility.isProSkin) ? "#bbbbff" : "#bbbbff";



        GUIStyle gsTest = new GUIStyle();

        gsTest.normal.background = ArchimatixEngine.nodeIcons ["Blank"];        // //Color.gray;
        gsTest.normal.textColor  = Color.white;


        Color textColor    = new Color(.82f, .80f, .85f);
        Color textColorSel = new Color(.98f, .95f, 1f);

        GUIStyle rubric = new GUIStyle(GUI.skin.label);

        rubric.normal.textColor = textColor;


        GUIStyle foldoutStyle = new GUIStyle(EditorStyles.foldout);

        foldoutStyle.normal.textColor  = textColor;
        foldoutStyle.active.textColor  = textColorSel;
        foldoutStyle.hover.textColor   = textColor;
        foldoutStyle.focused.textColor = textColorSel;

        foldoutStyle.onNormal.textColor  = textColor;
        foldoutStyle.onActive.textColor  = textColorSel;
        foldoutStyle.onHover.textColor   = textColor;
        foldoutStyle.onFocused.textColor = textColorSel;



        GUILayout.Space(10);

        GUILayout.BeginVertical(gsTest);



        EditorGUI.indentLevel++;


        EditorGUIUtility.labelWidth = 150;


        model.displayModelDefaults = EditorGUILayout.Foldout(model.displayModelDefaults, "Model Defaults", true, foldoutStyle);

        if (model.displayModelDefaults)
        {
            // PRECISION LEVEL
            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("Precision Level", rubric);
            GUILayout.FlexibleSpace();
            model.precisionLevel = (PrecisionLevel)EditorGUILayout.EnumPopup("", model.precisionLevel);
            EditorGUILayout.EndHorizontal();


            if (!AXNodeGraphEditorWindow.IsOpen)
            {
                GUILayout.Space(10);

                if (GUILayout.Button("Open in Node Graph"))
                {
                    AXNodeGraphEditorWindow.Init();
                }
            }


            //GUILayout.Space(20);



            // -- RUBRIC - MATERIAL --

            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("Material (Default)", rubric);
            GUILayout.FlexibleSpace();

            //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
            if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] {
                GUILayout.Width(16),
                GUILayout.Height(16)
            }))
            {
                Application.OpenURL("http://www.archimatix.com/manual/materials");
            }

            EditorGUILayout.EndHorizontal();

            // --------
            if (model.axMat.mat.name == "AX_GridPurple")
            {
                EditorGUILayout.HelpBox("Set the default Material for this model.", MessageType.Info);
            }

            // Material
            EditorGUI.BeginChangeCheck();

            model.axMat.mat = (Material)EditorGUILayout.ObjectField(model.axMat.mat, typeof(Material), true);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                model.remapMaterialTools();
                model.autobuild();
            }

            GUILayout.Space(10);

            // Texture //
            model.showDefaultMaterial = EditorGUILayout.Foldout(model.showDefaultMaterial, "Texture Scaling", true, foldoutStyle);
            if (model.showDefaultMaterial)
            {
                EditorGUI.BeginChangeCheck();
                model.axTex.scaleIsUnified = EditorGUILayout.Toggle("Unified Scaling", model.axTex.scaleIsUnified);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material scale");
                    model.axTex.scale.y = model.axTex.scale.x;
                    model.isAltered();
                }

                if (model.axTex.scaleIsUnified)
                {
                    EditorGUI.BeginChangeCheck();
                    model.axTex.scale.x = EditorGUILayout.FloatField("Scale", model.axTex.scale.x);
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);

                        model.axTex.scale.y = model.axTex.scale.x;
                        model.isAltered();
                        ArchimatixEngine.scheduleBuild();
                    }
                }
                else
                {
                    // Scale X
                    EditorGUI.BeginChangeCheck();
                    model.axTex.scale.x = EditorGUILayout.FloatField("Scale X", model.axTex.scale.x);
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                        model.isAltered();
                        ArchimatixEngine.scheduleBuild();
                    }

                    // Scale Y
                    EditorGUI.BeginChangeCheck();
                    model.axTex.scale.y = EditorGUILayout.FloatField("Scale Y", model.axTex.scale.y);
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                        model.isAltered();
                        ArchimatixEngine.scheduleBuild();
                    }
                }

                EditorGUI.BeginChangeCheck();
                model.axTex.runningU = EditorGUILayout.Toggle("Running U", model.axTex.runningU);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Running U");
                    model.isAltered();
                    ArchimatixEngine.scheduleBuild();
                }
            }

            GUILayout.Space(10);


            // PhysicMaterial //
            model.axMat.showPhysicMaterial = EditorGUILayout.Foldout(model.axMat.showPhysicMaterial, "Physics Material", true, foldoutStyle);
            if (model.axMat.showPhysicMaterial)
            {
                // PHYSIC MATERIAL
                EditorGUI.BeginChangeCheck();
                model.axMat.physMat = (PhysicMaterial)EditorGUILayout.ObjectField(model.axMat.physMat, typeof(PhysicMaterial), true);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default PhysicMaterial for " + model.name);
                    model.remapMaterialTools();
                    ArchimatixEngine.scheduleBuild();
                }

                // DENSITY
                EditorGUI.BeginChangeCheck();
                model.axMat.density = EditorGUILayout.FloatField("Density", model.axMat.density);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Material Density for " + model.name);
                    model.isAltered();
                    ArchimatixEngine.scheduleBuild();
                }
            }


            GUILayout.Space(20);



            model.automaticModelRegeneration = EditorGUILayout.ToggleLeft("Automatic Model Regeneration", model.automaticModelRegeneration);

            GUILayout.Space(20);

            // -- RUBRIC - LIGHTING --

            EditorGUILayout.BeginHorizontal();


            GUILayout.Space(20);
            GUILayout.Label("Lighting", rubric);


            //GUILayout.Label ("<color=" + rubricColor + "> <size=13>Lighting</size></color>", richLabelStyle);
            GUILayout.FlexibleSpace();

            //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
            if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] {
                GUILayout.Width(16),
                GUILayout.Height(16)
            }))
            {
                Application.OpenURL("http://www.archimatix.com/manual/lightmapping-with-archimatix");
            }

            EditorGUILayout.EndHorizontal();

            // --------


            // LIGHTMAP FLAGS ENABLED
            EditorGUI.BeginChangeCheck();
            model.staticFlagsEnabled = EditorGUILayout.ToggleLeft("Lightmap Flags Enabled", model.staticFlagsEnabled);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Static Masks Enabled change for " + model.name);

                model.staticFlagsJustEnabled = true;

                ArchimatixEngine.scheduleBuild();
            }

            // SECONDARY UVs
            if (model.staticFlagsEnabled)
            {
                //if (model.buildStatus == AXModel.BuildStatus.Generated)
                EditorGUI.BeginChangeCheck();
                model.createSecondaryUVs = EditorGUILayout.ToggleLeft("Create Secondary UVs (for Baked GI)", model.createSecondaryUVs);
                if (EditorGUI.EndChangeCheck())
                {
                    //if (model.createSecondaryUVs)
                    //	AXEditorUtilities.makeLightMapUVs (model);
                    model.createSecondaryUVsJustEnabled = true;
                }
            }



            GUILayout.Space(20);
        }         // displayModelDefaults

        /*
         * if (GUILayout.Button("Set All Objects as Lightmap Static"))
         * {
         *      Debug.Log("Set all");
         *      model.setLightmapStaticForAllPOs();
         * }
         */



        if (ArchimatixEngine.plevel == 3)
        {
            // RUNTIME //

            string countString = "";
            if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
            {
                countString = " (" + model.exposedParameterAliases.Count + ")";
            }

            model.displayModelRuntimeParameters = EditorGUILayout.Foldout(model.displayModelRuntimeParameters, "Runtime Parameters" + countString, true, foldoutStyle);

            if (model.displayModelRuntimeParameters)
            {
                //GUILayout.Label("<color="+rubricColor+"> <size=13>Pro Runtime Features</size></color>", richLabelStyle);


                // EXPOSED PARAMETERS
                //if (model.cycleSelectedAXGO != null)
                //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);

                //GUILayout.Label("Runtime Parameters");

                if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
                {
                    EditorGUI.BeginChangeCheck();
                    foreach (AXParameterAlias pa in model.exposedParameterAliases)
                    {
                        ParameterAliasGUILayout.OnGUI(pa);
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        model.isAltered();
                    }
                }
                else
                {
//					GUIStyle labelSty = new GUIStyle("Label");
//					labelSty.wordWrap = true;
//					labelSty.richText = true;

                    EditorGUILayout.HelpBox("You can add runntime parameters by opening any parameter in the graph and checking \"Enable Runtime\"", MessageType.Info);

                    //GUILayout.Label ("<color=\"gray\">You can add runntime parameters by opening any parameter in the graph and checking \"Enable Runtime\"</color>", labelSty);
                }


                GUILayout.Space(15);

                if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
                {
                    if (GUILayout.Button("Create Runtime Controller", GUILayout.Width(200)))
                    {
                        ArchimatixEngine.createControllerForModel = model;
                    }
                }



                // RUNTIME HANDLES
                //if (model.cycleSelectedAXGO != null)
                //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);
                if (model.runtimeHandleAliases != null && model.runtimeHandleAliases.Count > 0)
                {
                    //GUILayout.Label("Runtime Handles");


                    foreach (AXHandleRuntimeAlias rth in model.runtimeHandleAliases)
                    {
                        AXRuntimeHandlesGUI.OnGUI(rth);
                    }
                }



                GUILayout.Space(20);
            }
        }         // RUNTIME



        // RELATIONS

        if (model.selectedRelationInGraph != null)
        {
            GUILayout.Space(20);

            GUILayout.Label("<color=" + rubricColor + "> <size=13>Selected Relation</size></color>", richLabelStyle);


            AXRelation r = model.selectedRelationInGraph;
            RelationEditorGUI.OnGUI(r);
        }


        //GUILayout.Space(20);


        model.displayModelSelectedNodes = EditorGUILayout.Foldout(model.displayModelSelectedNodes, "Selected Node Controls", true, foldoutStyle);

        if (model.displayModelSelectedNodes)
        {
            // -- RUBRIC - SELECTED NODES --

            EditorGUILayout.BeginHorizontal();

            //GUILayout.Label("<color="+rubricColor+"> <size=13>Selected Nodes</size></color>", richLabelStyle);
            GUILayout.FlexibleSpace();

            //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
            if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] {
                GUILayout.Width(16),
                GUILayout.Height(16)
            }))
            {
                Application.OpenURL("http://www.archimatix.com/manual/node-selection");
            }

            EditorGUILayout.EndHorizontal();

            // --------



            //GUILayout.Space(10);

            if (model.selectedPOs != null && model.selectedPOs.Count > 0)
            {
                for (int i = 0; i < model.selectedPOs.Count; i++)
                {
                    //Debug.Log(i);
                    AXParametricObject po = model.selectedPOs [i];

                    //Debug.Log(i+" ------------------------ po.Name="+po.Name+ " -- " + po.generator.AllInput_Ps.Count);


                    doPO(po);

                    // for subnodes...

                    if (po.generator.AllInput_Ps != null)
                    {
                        for (int j = po.generator.AllInput_Ps.Count - 1; j >= 0; j--)
                        {
                            AXParameter p = po.generator.AllInput_Ps [j];

                            if (p.DependsOn != null)
                            {
                                AXParametricObject spo = p.DependsOn.parametricObject;
                                doPO(spo);

                                // sub-sub nodes...
                                for (int k = spo.generator.AllInput_Ps.Count - 1; k >= 0; k--)
                                {
                                    if (spo.generator.AllInput_Ps [k].DependsOn != null)
                                    {
                                        doPO(spo.generator.AllInput_Ps [k].DependsOn.parametricObject);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                GUILayout.Label("<color=\"gray\">...no nodes selected</color>", richLabelStyle);
            }

            GUILayout.Space(50);
        }

        EditorGUI.indentLevel--;

        GUILayout.EndVertical();
//		Editor currentTransformEditor = Editor.CreateEditor(model.gameObject.);
//		if (currentTransformEditor != null) {
//            currentTransformEditor.OnInspectorGUI ();
//        }



        //model.controls[0].val = EditorGUILayout.Slider(model.controls[0].val, 0, 100);


        /*
         * switch (e.type)
         * {
         * case EventType.KeyUp:
         * case EventType.mouseUp:
         *
         *      model.autobuild();
         *      //e.Use ();
         *
         *      //return;
         *      break;
         *
         * case EventType.mouseDown:
         *
         *      //model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * }
         */


        //DrawDefaultInspector ();
    }
Example #3
0
    public override void OnInspectorGUI()
    {
        //if (Event.current.type != EventType.Layout)
        //	return;
        AXModel model = (AXModel)target;

        Event e = Event.current;


        //Debug.Log(evt.type);
        switch (e.type)
        {
        case EventType.Layout:
            if (doAutobuild)
            {
                doAutobuild = false;
                model.autobuild();
            }
            break;


        case EventType.MouseDown:
            //Debug.Log("Down");

            break;

        case EventType.MouseUp:

            doAutobuild = true;
            break;

        case EventType.KeyUp:
            Undo.RegisterCompleteObjectUndo(model, "Key Up");
            //Debug.Log("KeyUp");
            doAutobuild = true;
            break;

        case EventType.DragUpdated:
            //Debug.Log("Dragging");
            break;

        case EventType.DragPerform:
            //DragAndDrop.AcceptDrag();
            //Debug.Log("Drag and Drop not supported... yet");
            Undo.RegisterCompleteObjectUndo(model, "Default material scale");

            doAutobuild = true;
            break;
        }

        /*
         * switch (e.type)
         * {
         * case EventType.mouseUp:
         *
         *      model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * case EventType.mouseDown:
         *
         *      model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * }
         */



        //myTarget.MyValue = EditorGUILayout.IntSlider("Val-you", myTarget.MyValue, 1, 10);



        if (richLabelStyle == null)
        {
            richLabelStyle          = new GUIStyle(GUI.skin.label);
            richLabelStyle.richText = true;
            richLabelStyle.wordWrap = true;
        }
        //if (infoIconTexture = null)


        String rubricColor = (EditorGUIUtility.isProSkin) ? "#bbbbff" : "#660022";



        EditorGUIUtility.labelWidth = 150;



        model.precisionLevel = (PrecisionLevel)EditorGUILayout.EnumPopup("Precision Level", model.precisionLevel);


        if (!AXNodeGraphEditorWindow.IsOpen)
        {
            GUILayout.Space(10);

            if (GUILayout.Button("Open in Node Graph"))
            {
                AXNodeGraphEditorWindow.Init();
            }
        }


        GUILayout.Space(20);



        // -- RUBRIC - MATERIAL --

        EditorGUILayout.BeginHorizontal();

        GUILayout.Label("<color=" + rubricColor + "> <size=13>Material (Default)</size></color>", richLabelStyle);
        GUILayout.FlexibleSpace();

        //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
        if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] { GUILayout.Width(16), GUILayout.Height(16) }))
        {
            Application.OpenURL("http://www.archimatix.com/manual/materials");
        }

        EditorGUILayout.EndHorizontal();

        // --------


        // Material
        EditorGUI.BeginChangeCheck();

        model.axMat.mat = (Material)EditorGUILayout.ObjectField(model.axMat.mat, typeof(Material), true);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
            model.remapMaterialTools();
            model.autobuild();
        }



        // Texture //
        model.showDefaultMaterial = EditorGUILayout.Foldout(model.showDefaultMaterial, "Texture Scaling");
        if (model.showDefaultMaterial)
        {
            EditorGUI.BeginChangeCheck();
            model.axTex.scaleIsUnified = EditorGUILayout.Toggle("Unified Scaling", model.axTex.scaleIsUnified);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Default material scale");
                model.axTex.scale.y = model.axTex.scale.x;
                model.isAltered();
            }

            if (model.axTex.scaleIsUnified)
            {
                EditorGUI.BeginChangeCheck();
                model.axTex.scale.x = EditorGUILayout.FloatField("Scale", model.axTex.scale.x);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);

                    model.axTex.scale.y = model.axTex.scale.x;
                    model.isAltered();
                }
            }
            else
            {
                // Scale X
                EditorGUI.BeginChangeCheck();
                model.axTex.scale.x = EditorGUILayout.FloatField("Scale X", model.axTex.scale.x);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                    model.isAltered();
                }

                // Scale Y
                EditorGUI.BeginChangeCheck();
                model.axTex.scale.y = EditorGUILayout.FloatField("Scale Y", model.axTex.scale.y);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                    model.isAltered();
                }
            }

            EditorGUI.BeginChangeCheck();
            model.axTex.runningU = EditorGUILayout.Toggle("Running U", model.axTex.runningU);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Running U");
                model.isAltered();
            }
        }

        // PhysicMaterial //
        model.axMat.showPhysicMaterial = EditorGUILayout.Foldout(model.axMat.showPhysicMaterial, "Physics Material");
        if (model.axMat.showPhysicMaterial)
        {
            // PHYSIC MATERIAL
            EditorGUI.BeginChangeCheck();
            model.axMat.physMat = (PhysicMaterial)EditorGUILayout.ObjectField(model.axMat.physMat, typeof(PhysicMaterial), true);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Default PhysicMaterial for " + model.name);
                model.remapMaterialTools();
                model.autobuild();
            }

            // DENSITY
            EditorGUI.BeginChangeCheck();
            model.axMat.density = EditorGUILayout.FloatField("Density", model.axMat.density);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Material Density for " + model.name);
                model.isAltered();
            }
        }


        GUILayout.Space(20);



        // -- RUBRIC - LIGHTING --

        EditorGUILayout.BeginHorizontal();

        GUILayout.Label("<color=" + rubricColor + "> <size=13>Lighting</size></color>", richLabelStyle);
        GUILayout.FlexibleSpace();

        //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
        if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] { GUILayout.Width(16), GUILayout.Height(16) }))
        {
            Application.OpenURL("http://www.archimatix.com/manual/lightmapping-with-archimatix");
        }

        EditorGUILayout.EndHorizontal();

        // --------


        // LIGHTMAP FLAGS ENABLED
        EditorGUI.BeginChangeCheck();
        model.staticFlagsEnabled = EditorGUILayout.ToggleLeft("Lightmap Flags Enabled", model.staticFlagsEnabled);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RegisterCompleteObjectUndo(model, "Static Masks Enabled change for " + model.name);

            model.staticFlagsJustEnabled = true;

            model.autobuild();
        }

        // SECONDARY UVs
        if (model.staticFlagsEnabled)
        {
            //if (model.buildStatus == AXModel.BuildStatus.Generated)
            EditorGUI.BeginChangeCheck();
            model.createSecondaryUVs = EditorGUILayout.ToggleLeft("Create Secondary UVs (for Baked GI)", model.createSecondaryUVs);
            if (EditorGUI.EndChangeCheck())
            {
                //if (model.createSecondaryUVs)
                //	AXEditorUtilities.makeLightMapUVs (model);
                model.createSecondaryUVsJustEnabled = true;
            }
        }



        GUILayout.Space(20);



        /*
         * if (GUILayout.Button("Set All Objects as Lightmap Static"))
         * {
         *      Debug.Log("Set all");
         *      model.setLightmapStaticForAllPOs();
         * }
         */



        if (ArchimatixEngine.plevel == 3)
        {
            // RUNTIME //

            GUILayout.Label("<color=" + rubricColor + "> <size=13>Pro Runtime Features</size></color>", richLabelStyle);


            // EXPOSED PARAMETERS
            //if (model.cycleSelectedAXGO != null)
            //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);

            GUILayout.Label("Runtime Parameters");

            EditorGUI.BeginChangeCheck();
            foreach (AXParameterAlias pa in model.exposedParameterAliases)
            {
                ParameterAliasGUILayout.OnGUI(pa);
            }
            if (EditorGUI.EndChangeCheck())
            {
                model.isAltered();
            }

            GUILayout.Space(30);

            if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
            {
                if (GUILayout.Button("Create Runtime Controller", GUILayout.Width(200)))
                {
                    ArchimatixEngine.createControllerForModel = model;
                }
            }



            // RUNTIME HANDLES
            //if (model.cycleSelectedAXGO != null)
            //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);
            if (model.runtimeHandleAliases != null && model.runtimeHandleAliases.Count > 0)
            {
                GUILayout.Label("Runtime Handles");


                foreach (AXHandleRuntimeAlias rth in model.runtimeHandleAliases)
                {
                    AXRuntimeHandlesGUI.OnGUI(rth);
                }
            }


            GUILayout.Space(20);
        }         // RUNTIME



        // RELATIONS

        if (model.selectedRelationInGraph != null)
        {
            GUILayout.Space(20);

            GUILayout.Label("<color=" + rubricColor + "> <size=13>Selected Relation</size></color>", richLabelStyle);


            AXRelation r = model.selectedRelationInGraph;
            RelationEditorGUI.OnGUI(r);
        }


        GUILayout.Space(20);



        // -- RUBRIC - SELECTED NODES --

        EditorGUILayout.BeginHorizontal();

        GUILayout.Label("<color=" + rubricColor + "> <size=13>Selected Nodes</size></color>", richLabelStyle);
        GUILayout.FlexibleSpace();

        //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
        if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] { GUILayout.Width(16), GUILayout.Height(16) }))
        {
            Application.OpenURL("http://www.archimatix.com/manual/node-selection");
        }

        EditorGUILayout.EndHorizontal();

        // --------



        GUILayout.Space(10);

        if (model.selectedPOs != null && model.selectedPOs.Count > 0)
        {
            for (int i = 0; i < model.selectedPOs.Count; i++)
            {
                //Debug.Log(i);
                AXParametricObject po = model.selectedPOs[i];

                //Debug.Log(i+" ------------------------ po.Name="+po.Name+ " -- " + po.generator.AllInput_Ps.Count);


                doPO(po);

                // for subnodes...

                if (po.generator.AllInput_Ps != null)
                {
                    for (int j = po.generator.AllInput_Ps.Count - 1; j >= 0; j--)
                    {
                        AXParameter p = po.generator.AllInput_Ps[j];

                        if (p.DependsOn != null)
                        {
                            AXParametricObject spo = p.DependsOn.parametricObject;
                            doPO(spo);

                            // sub-sub nodes...
                            for (int k = spo.generator.AllInput_Ps.Count - 1; k >= 0; k--)
                            {
                                if (spo.generator.AllInput_Ps[k].DependsOn != null)
                                {
                                    doPO(spo.generator.AllInput_Ps[k].DependsOn.parametricObject);
                                }
                            }
                        }
                    }
                }
            }
        }
        else
        {
            GUILayout.Label("...no nodes selected");
        }

        GUILayout.Space(50);



        //model.controls[0].val = EditorGUILayout.Slider(model.controls[0].val, 0, 100);


        /*
         * switch (e.type)
         * {
         * case EventType.KeyUp:
         * case EventType.mouseUp:
         *
         *      model.autobuild();
         *      //e.Use ();
         *
         *      //return;
         *      break;
         *
         * case EventType.mouseDown:
         *
         *      //model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * }
         */


        //DrawDefaultInspector ();
    }