示例#1
0
        public static void DrawLevels(MatrixGenerators.Levels200 gen)
        {
            using (Cell.LinePx((GeneratorDraw.nodeWidth - 10) / 2))           //square internal grid cell
            //using (Timer.Start("DrawLevels"))
            {
                Draw.Rect(new Color(1, 1, 1, 0.5f));

                using (Cell.Padded(1, 1, 7, 0))
                    LevelsDraw.DrawLevels(ref gen.inMin, ref gen.inMax, ref gen.gamma, ref gen.outMin, ref gen.outMax, gen.histogram);
            }

            using (Cell.LineStd)
            {
                if (!gen.guiParams)
                {
                    Draw.Rect(new Color(1, 1, 1, 0.5f));
                }

                using (new Draw.FoldoutGroup(ref gen.guiParams, "Parameters", isLeft: true))
                    if (gen.guiParams)
                    {
                        using (Cell.LineStd) {
                            Draw.Field(ref gen.inMin, "In Low");
                            Cell.current.Expose(gen.id, "inMin", typeof(float));
                            Draw.AddFieldToCellObj(typeof(MatrixGenerators.Levels200), "inMin");
                        }
                        using (Cell.LineStd) {
                            Draw.Field(ref gen.gamma, "Gamma");
                            Cell.current.Expose(gen.id, "gamma", typeof(float));
                            Draw.AddFieldToCellObj(typeof(MatrixGenerators.Levels200), "gamma");
                        }
                        using (Cell.LineStd) {
                            Draw.Field(ref gen.inMax, "In High");
                            Cell.current.Expose(gen.id, "inMax", typeof(float));
                            Draw.AddFieldToCellObj(typeof(MatrixGenerators.Levels200), "inMax");
                        }

                        Cell.EmptyLinePx(5);

                        using (Cell.LineStd) {
                            Draw.Field(ref gen.outMin, "Out Low");
                            Cell.current.Expose(gen.id, "outMin", typeof(float));
                            Draw.AddFieldToCellObj(typeof(MatrixGenerators.Levels200), "outMin");
                        }
                        using (Cell.LineStd) {
                            Draw.Field(ref gen.outMax, "Out High");
                            Cell.current.Expose(gen.id, "outMax", typeof(float));
                            Draw.AddFieldToCellObj(typeof(MatrixGenerators.Levels200), "outMax");
                        }
                    }
            }
        }
示例#2
0
        public static void DrawSelector(MatrixGenerators.Selector200 gen)
        {
            using (Cell.Padded(1, 1, 0, 0))
            {
                using (Cell.LineStd) Draw.Field(ref gen.rangeDet, "Set Range");
                using (Cell.LineStd)
                {
                    Draw.Field(ref gen.units, "Units");
                    Cell.current.Expose(gen.id, "units", typeof(int));
                    Draw.AddFieldToCellObj(typeof(MatrixGenerators.Selector200), "units");
                }

                if (gen.rangeDet == MatrixGenerators.Selector200.RangeDet.MinMax)
                {
                    using (Cell.LineStd)
                    {
                        Draw.Field(ref gen.from, "From");
                        Cell.current.Expose(gen.id, "from", typeof(Vector2));
                        Draw.AddFieldToCellObj(typeof(MatrixGenerators.Selector200), "from");
                    }
                    using (Cell.LineStd)
                    {
                        Draw.Field(ref gen.to, "To");
                        Cell.current.Expose(gen.id, "to", typeof(Vector2));
                        Draw.AddFieldToCellObj(typeof(MatrixGenerators.Selector200), "to");
                    }
                }
                else
                {
                    float from       = (gen.from.x + gen.from.y) / 2;
                    float to         = (gen.to.x + gen.to.y) / 2;
                    float transition = (gen.from.y - gen.from.x);

                    using (Cell.LineStd)
                    {
                        Draw.Field(ref from, "From");
                        Draw.AddFieldToCellObj(typeof(MatrixGenerators.Selector200), "from");                         //not a single value, but the one with transition
                    }
                    using (Cell.LineStd)
                    {
                        Draw.Field(ref to, "To");
                        Draw.AddFieldToCellObj(typeof(MatrixGenerators.Selector200), "to");
                    }
                    using (Cell.LineStd) Draw.Field(ref transition, "Transition");

                    gen.from.x = from - transition / 2;
                    gen.from.y = from + transition / 2;
                    gen.to.x   = to - transition / 2;
                    gen.to.y   = to + transition / 2;
                }
            }
        }
示例#3
0
        public static void CurveGeneratorEditor(MatrixGenerators.UnityCurve200 gen)
        {
            using (Cell.LinePx(GeneratorDraw.nodeWidth + 4))           //don't really know why 4
                using (Cell.Padded(5))
                {
                    Draw.AnimationCurve(gen.curve);
                    Draw.AddFieldToCellObj(typeof(MatrixGenerators.UnityCurve200), "curve");

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.RefreshMapMagic(gen);
                    }
                }
        }