Esempio n. 1
0
        public void Editor_DrawCustomParamsGUI()
        {
#if UNITY_EDITOR
            string label = "Noise Painting";
            string id    = "noise-painter";

            GCommonGUI.Foldout(label, true, id, () =>
            {
                GNoisePainterParams param = GTexturePainterCustomParams.Instance.Noise;

                EditorGUILayout.GetControlRect(GUILayout.Height(1));
                Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(200));
                RenderTexture preview = GTerrainTexturePainter.Internal_GetRenderTexture(null, 200, 0);
                RenderNoiseTexture(preview, null);
                EditorGUI.DrawPreviewTexture(r, preview, null, ScaleMode.ScaleToFit);
                EditorGUILayout.GetControlRect(GUILayout.Height(1));

                param.Type          = (GNoiseType)EditorGUILayout.EnumPopup("Type", param.Type);
                param.Origin        = GCommonGUI.InlineVector2Field("Origin", param.Origin);
                param.Frequency     = EditorGUILayout.FloatField("Frequency", param.Frequency);
                param.Lacunarity    = EditorGUILayout.FloatField("Lacunarity", param.Lacunarity);
                param.Persistence   = EditorGUILayout.FloatField("Persistence", param.Persistence);
                param.Octaves       = EditorGUILayout.IntField("Octaves", param.Octaves);
                param.Seed          = EditorGUILayout.FloatField("Seed", param.Seed);
                param.UseWorldSpace = EditorGUILayout.Toggle("World Space", param.UseWorldSpace);

                GTexturePainterCustomParams.Instance.Noise = param;

                EditorUtility.SetDirty(GTexturePainterCustomParams.Instance);
            });
#endif
        }
Esempio n. 2
0
        public void Editor_DrawCustomParamsGUI()
        {
#if UNITY_EDITOR
            string label = "Remap Painting";
            string id    = "remap-painter";

            GCommonGUI.Foldout(label, true, id, () =>
            {
                GRemapPainterParams param = GTexturePainterCustomParams.Instance.Remap;
                param.Curve = EditorGUILayout.CurveField("Curve", param.Curve, Color.red, GCommon.UnitRect);
                GTexturePainterCustomParams.Instance.Remap = param;
                EditorUtility.SetDirty(GTexturePainterCustomParams.Instance);
            });
#endif
        }
Esempio n. 3
0
        public void Editor_DrawCustomParamsGUI()
        {
#if UNITY_EDITOR
            string label = "Terrace Painting";
            string id    = "terrace-painter-params";

            GCommonGUI.Foldout(label, true, id, () =>
            {
                GTerracePainterParams param = GTexturePainterCustomParams.Instance.Terrace;
                param.StepCount             = EditorGUILayout.IntField("Step Count", param.StepCount);
                GTexturePainterCustomParams.Instance.Terrace = param;
                EditorUtility.SetDirty(GTexturePainterCustomParams.Instance);
            });
#endif
        }
Esempio n. 4
0
        public void Editor_DrawCustomParamsGUI()
        {
#if UNITY_EDITOR
            string label = "Mask Painting";
            string id    = "mask-painter";

            GCommonGUI.Foldout(label, true, id, () =>
            {
                GMaskPainterParams param = GTexturePainterCustomParams.Instance.Mask;
                string[] labels          = new string[]
                {
                    "R (Terrain Mask)",
                    "G (Smooth Normal Mask)",
                    "B",
                    "A"
                };
                int[] values = new int[]
                {
                    1,
                    2,
                    4,
                    8
                };

                param.Channel   = (GTextureChannel)EditorGUILayout.IntPopup("Channel", (int)param.Channel, labels, values);
                param.Visualize = EditorGUILayout.Toggle("Visualize", param.Visualize);
                GTexturePainterCustomParams.Instance.Mask = param;
                EditorUtility.SetDirty(GTexturePainterCustomParams.Instance);

#if GRIFFIN_VEGETATION_STUDIO_PRO
                GCommonGUI.Header("Vegetation Studio Pro");
                if (GUILayout.Button("Refresh Vegetation Systems"))
                {
                    VegetationStudioManager.RefreshVegetationSystem();
                }
#endif
            });
#endif
        }