Beispiel #1
0
        public Rect DrawTextureWIthChannelAndSwitcher(Rect r, bool enable,
                                                      string[] _texture,
                                                      POP_CLASS texture_SWITCHER, POP_CLASS pop)
        {
            int index = 0;

            if (texture_SWITCHER != null)
            {
                r.height = FastWaterModel20ControllerEditor.H;
                texture_SWITCHER.DrawPop(null, r); r.y += r.height;
                index = texture_SWITCHER.VALUE;
            }
            string texture = _texture[index];

            // maskTexture = FIELDS._MainTex;

            //Color c = new Color(1, 0, 0, 0);

            //r.height = FastWaterModel20ControllerEditor.H * 2;
            // EditorGUI.HelpBox(r, "Used MainTexture (R)", MessageType.None); r.y += r.height;
            // r = DRAW_GRAPHIC(r, 40, target.compiler.GetTexture(maskTexture) as Texture2D, usemask, c); r.y += r.height;



            if (index == texture_SWITCHER.defaultIndex)
            {
                r = DRAW_BG_TEXTURE(r, "Texture", texture, enable, out tV, null); r.y += r.height;
            }
            else
            {
                r = DRAW_GRAPHIC(r, 50, target.compiler.GetTexture(texture) as Texture2D, enable); r.y += r.height;
                //  r = DRAW_BG_TEXTURE(r, "Texture", texture, usemask, out tV, null); r.y += r.height;
            }
            Color c = new Color(1, 0, 0, 0);

            if (pop != null)
            { //r.height = FastWaterModel20ControllerEditor.H * 2;
              // EditorGUI.HelpBox(r, "Used MainTexture", MessageType.None);
              //r.y += r.height;
                r.height = FastWaterModel20ControllerEditor.H;
                pop.DrawPop(null, r); r.y += r.height;
                c = GET_COLOR(pop.VALUE);
            }
            else
            {
                r.height = FastWaterModel20ControllerEditor.H * 2;
                EditorGUI.HelpBox(r, "Used MainTexture (R)", MessageType.None); r.y += r.height;
            }
            r = DRAW_GRAPHIC(r, 30, target.compiler.GetTexture(texture) as Texture2D, enable, c); r.y += r.height;
            return(r);
        }
Beispiel #2
0
        public Rect DRAW_MASK_PANEL(Rect r, string name, string help, string FEATURE,
                                    string tile,
                                    string offset,
                                    string amount,
                                    string min,
                                    string max,
                                    string maskDebug,
                                    ref bool enable,
                                    POP_CLASS pop, Vector2?amountClamp = null)
        {
            if (!target.compiler.material)
            {
                return(r);
            }

            amountClamp = amountClamp ?? new Vector2(0, 5);

            var S       = 0;
            var usemask = DRAW_TOGGLE(r, name, FEATURE, enable, out tV) & enable;

            var oc = GUI.color;

            GUI.color *= new Color32(255, 255, 211, 255);

            r.y += 31;
            if (help != null)
            {
                var h = EditorStyles.helpBox.CalcHeight(new GUIContent(help), r.width);
                r.height = h;
                EditorGUI.HelpBox(r, help, MessageType.None); r.y += r.height;
            }

            var og = GUI.enabled;

            GUI.enabled = usemask;
            enable      = usemask;
            string maskTexture;


            maskTexture = FIELDS._MainTex;

            Color c = new Color(1, 0, 0, 0);

            if (pop != null)
            {
                r.height = FastWaterModel20ControllerEditor.H * 2;
                EditorGUI.HelpBox(r, "Used MainTexture", MessageType.None);
                r.y     += r.height;
                r.height = FastWaterModel20ControllerEditor.H;
                pop.DrawPop(null, r); r.y += r.height;
                c = GET_COLOR(pop.VALUE);
            }
            else
            {
                r.height = FastWaterModel20ControllerEditor.H * 2;
                EditorGUI.HelpBox(r, "Used MainTexture (R)", MessageType.None); r.y += r.height;
            }
            r = DRAW_GRAPHIC(r, 40, target.compiler.GetTexture(maskTexture) as Texture2D, usemask, c); r.y += r.height;
            // r = DRAW_SLIDER( r, "Tile XY", tile, 0, 2, usemask ); r.y += r.height + S;
            //  r = DRAW_SLIDER( r, "Mask Amount", amount, amountClamp.Value.x, amountClamp.Value.y, usemask ); r.y += r.height + S;
            r    = DRAW_DOUBLEFIELDS(r, "Amount/Tile", new[] { amount, tile }, new[] { amountClamp.Value.x, 0f }, new[] { amountClamp.Value.y, 5 }, usemask, new Color32(255, 230, 180, 255), 10, seconddiv: 10);
            r.y += r.height + S;
            r    = DRAW_VECTOR(r, "Offset X/Y", offset, -20, 20, enable, div: 100); r.y += r.height + S;
            r    = DRAW_DOUBLEFIELDS(r, "Min/Max", new[] { min, max }, new[] { -1, 0.0f }, new[] { 2f, 10 }, usemask); r.y += r.height + S;

            DRAW_TOGGLE(r, "Debug Mask", maskDebug, enable, out tV);
            r.y += 31;



            GUI.enabled = og;

            GUI.color = oc;
            return(r);
            //r = target.DRAW_SLIDER( r, "Mask Clamp", FIELDS._ReflectionMask_UpClamp, 0.5f, 10, usemask ); r.y += r.height + S;
        }