public override void OnBodyGUI()
        {
            //Output
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Output"));

            //Draw mix method enum
            SerializedProperty mixType = serializedObject.FindProperty("Mix");

            NodeEditorGUILayout.PropertyField(mixType, new GUIContent("Mix Type"));

            //Draw Instance Ports with colors
            if (!Bcn.DidAddPort)
            {
                NodePort[] ports = Bcn.GetInstanceInputs();

                for (var i = 0; i < ports.Length; i++)
                {
                    NodePort p = ports[i];
                    EditorGUILayout.BeginHorizontal();
                    NodeEditorGUILayout.PortField(p, GUILayout.ExpandWidth(false));

                    BiomeNode node = p.GetInputValue <BiomeNode>();
                    if (node != null)
                    {
#if UNITY_2018_1_OR_NEWER
                        EditorGUILayout.ColorField(GUIContent.none, node.PreviewColor, false, false, false,
                                                   GUILayout.MaxWidth(32f));
#else
                        EditorGUILayout.ColorField(GUIContent.none, node.PreviewColor,
                                                   false, false, false, null, GUILayout.MaxWidth(32f));
#endif
                    }

                    EditorGUILayout.EndHorizontal();
                }
            }
            else
            {
                Bcn.DidAddPort = false;
            }


            //Show Preview
            PreviewField.Show(Bcn);
        }
        public override void OnBodyGUI()
        {
            EditorGUI.BeginChangeCheck();
            OnBodyGUI(PreviewableNode.FieldNames);
            if (EditorGUI.EndChangeCheck())
            {
                //If OctaveCount falls outside of bounds, reset
                SerializedProperty ocProp = serializedObject.FindProperty("OctaveCount");
                int count = Mathf.Clamp(ocProp.intValue, OCTAVE_CNT_MIN, OCTAVE_CNT_MAX);
                serializedObject.FindProperty("OctaveCount").intValue = count;

                //Since we captured the BeginChangeCheck from AbsGeneratorNode
                //we have to call update OnValueChange() manually
                _fractal.OnValueChange();
            }

            PreviewField.Show(_fractal);
        }
        public override void OnBodyGUI()
        {
            //Draw default except for cutoff and preview
            base.OnBodyGUI(false, new[] { "Cutoff" });

            SerializedProperty prop = serializedObject.FindProperty("Cutoff");
            Rect ctrl  = EditorGUILayout.GetControlRect(true, EditorGUIUtility.singleLineHeight);
            var  label = EditorGUI.BeginProperty(ctrl, new GUIContent("Cutoff"), prop);

            EditorGUI.BeginChangeCheck();
            var newValue = EditorGUI.Slider(ctrl, label, prop.floatValue, 0f, 1f);

            if (EditorGUI.EndChangeCheck())
            {
                prop.floatValue = newValue;
            }
            EditorGUI.EndProperty();

            PreviewField.Show(Round);
        }
        public override void OnBodyGUI()
        {
            //Output
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Output"));

            //Biome Name
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Name"), new GUIContent("Biome Name"));

            //Preview Color
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("PreviewColor"), new GUIContent("Preview Color"));

            //Blend
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Blend"));

            //Maps
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Masks");

            ShowMapField("HeightmapMinMaxMask", "UseHeightmap", "Heightmap");
            ShowMapField("TemperatureMinMaxMask", "UseTemperature", "Temperature");
            ShowMapField("MoistureMinMaxMask", "UseMoisture", "Moisture");

            //Splats
            EditorGUILayout.Space();
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("SplatDetails"), new GUIContent("Splat"));

            //Trees
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Trees"), new GUIContent("Trees"));

            //Grass
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Grass"), new GUIContent("Grass"));

            //Objects
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Objects"));

            //Show Preview
            PreviewField.Show(Bn);

            serializedObject.ApplyModifiedProperties();
        }
Example #5
0
        public override void OnBodyGUI()
        {
            RenderBiomeOrderEditor();

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Biomes"), new GUIContent("Biomes"));
            En.BlendStrategy = (BlendStrategy)EditorGUILayout.EnumPopup("Blend Strategy", En.BlendStrategy);

            // Render order of biomes
            if (En.BlendStrategy == BlendStrategy.ORDERED && _reorderableList != null)
            {
                _reorderableList.DoLayoutList();
            }

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("HeightMap"), new GUIContent("HeightMap"));
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("TemperatureMap"),
                                              new GUIContent("TemperatureMap"));
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("MoistureMap"),
                                              new GUIContent("MoistureMap"));

            PreviewField.Show(En, true);

            serializedObject.ApplyModifiedProperties();
        }
Example #6
0
 void Awake()
 {
     instance = this;
 }
 public override void OnBodyGUI()
 {
     NodeEditorGUILayout.PortField(GrassDetailNode.GetOutputPort("Output"));
     DetailField.Show(this);
     PreviewField.Show(GrassDetailNode);
 }
Example #8
0
 public override void ShouldShowPreviewGenerator()
 {
     PreviewField.Show(_generator);
 }