Exemplo n.º 1
0
 public P3dWindowBrushTip(P3dWindowBrushTechnique newTechnique)
 {
     Technique = newTechnique;
 }
Exemplo n.º 2
0
        public void OnGUI()
        {
            Technique = (P3dWindowBrushTechnique)EditorGUILayout.EnumPopup("Technique", Technique);

            EditorGUI.indentLevel++;
            switch (Technique)
            {
            case P3dWindowBrushTechnique.Replace:
            {
                P3dGroup_Drawer.OnGUI(P3dHelper.Reserve(), this, new GUIContent("Group"));
                Texture = EditorGUI.ObjectField(P3dHelper.Reserve(), "Texture", Texture, typeof(Texture), false) as Texture;
                Color   = EditorGUILayout.ColorField("Color", Color);
                Opacity = EditorGUILayout.Slider("Opacity", Opacity, 0.0f, 1.0f);
            }
            break;

            case P3dWindowBrushTechnique.Fill:
            {
                P3dGroup_Drawer.OnGUI(P3dHelper.Reserve(), this, new GUIContent("Group"));
                BlendMode = (P3dBlendMode)EditorGUILayout.EnumPopup("Blend Mode", BlendMode);
                Texture   = EditorGUI.ObjectField(P3dHelper.Reserve(), "Texture", Texture, typeof(Texture), false) as Texture;
                Color     = EditorGUILayout.ColorField("Color", Color);
                Opacity   = EditorGUILayout.Slider("Opacity", Opacity, 0.0f, 1.0f);
            }
            break;

            case P3dWindowBrushTechnique.Sphere:
            {
                P3dGroup_Drawer.OnGUI(P3dHelper.Reserve(), this, new GUIContent("Group"));
                BlendMode = (P3dBlendMode)EditorGUILayout.EnumPopup("Blend Mode", BlendMode);
                Color     = EditorGUILayout.ColorField("Color", Color);
                Opacity   = EditorGUILayout.Slider("Opacity", Opacity, 0.0f, 1.0f);
                Radius    = EditorGUILayout.FloatField("Radius", Radius);
                Hardness  = EditorGUILayout.FloatField("Hardness", Hardness);
            }
            break;

            case P3dWindowBrushTechnique.Decal:
            {
                P3dGroup_Drawer.OnGUI(P3dHelper.Reserve(), this, new GUIContent("Group"));
                BlendMode = (P3dBlendMode)EditorGUILayout.EnumPopup("Blend Mode", BlendMode);
                P3dHelper.BeginColor(Texture == null);
                Texture = EditorGUI.ObjectField(P3dHelper.Reserve(), "Texture", Texture, typeof(Texture), false) as Texture;
                P3dHelper.EndColor();
                if (BlendMode == P3dBlendMode.Replace)
                {
                    P3dHelper.BeginColor(Shape == null);
                    Shape = EditorGUI.ObjectField(P3dHelper.Reserve(), "Shape", Shape, typeof(Texture), false) as Texture;
                    P3dHelper.EndColor();
                }
                Color       = EditorGUILayout.ColorField("Color", Color);
                Opacity     = EditorGUILayout.Slider("Opacity", Opacity, 0.0f, 1.0f);
                Radius      = EditorGUILayout.FloatField("Radius", Radius);
                Angle       = EditorGUILayout.FloatField("Angle", Angle);
                Depth       = EditorGUILayout.FloatField("Depth", Depth);
                Hardness    = EditorGUILayout.FloatField("Hardness", Hardness);
                NormalFront = EditorGUILayout.Slider("Normal Front", NormalFront, 0.0f, 1.0f);
                NormalBack  = EditorGUILayout.Slider("Normal Back", NormalBack, 0.0f, 1.0f);
                NormalRange = EditorGUILayout.Slider("Normal Range", NormalRange, 0.001f, 0.25f);
            }
            break;

            case P3dWindowBrushTechnique.SphereTriplanar:
            {
                P3dGroup_Drawer.OnGUI(P3dHelper.Reserve(), this, new GUIContent("Group"));
                BlendMode = (P3dBlendMode)EditorGUILayout.EnumPopup("Blend Mode", BlendMode);
                P3dHelper.BeginColor(Texture == null);
                Texture = EditorGUI.ObjectField(P3dHelper.Reserve(), "Texture", Texture, typeof(Texture), false) as Texture;
                P3dHelper.EndColor();
                Strength = EditorGUILayout.FloatField("Strength", Strength);
                Tiling   = EditorGUILayout.FloatField("Tiling", Tiling);
                Color    = EditorGUILayout.ColorField("Color", Color);
                Opacity  = EditorGUILayout.Slider("Opacity", Opacity, 0.0f, 1.0f);
                Radius   = EditorGUILayout.FloatField("Radius", Radius);
                Hardness = EditorGUILayout.FloatField("Hardness", Hardness);
            }
            break;

            case P3dWindowBrushTechnique.SphereBlur:
            {
                P3dGroup_Drawer.OnGUI(P3dHelper.Reserve(), this, new GUIContent("Group"));
                Opacity    = EditorGUILayout.Slider("Opacity", Opacity, 0.0f, 1.0f);
                KernelSize = EditorGUILayout.Slider("Kernel Size", KernelSize, 0.0001f, 0.1f);
                Radius     = EditorGUILayout.FloatField("Radius", Radius);
                Hardness   = EditorGUILayout.FloatField("Hardness", Hardness);
            }
            break;
            }
            EditorGUI.indentLevel--;
        }