コード例 #1
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");

				if (gen.rangeDet == MatrixGenerators.Selector200.RangeDet.MinMax)
				{
					using (Cell.LineStd) Draw.Field(ref gen.from, "From");
					using (Cell.LineStd) Draw.Field(ref gen.to, "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");
					using (Cell.LineStd) Draw.Field(ref to, "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;
				}
			}
		}
コード例 #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;
                }
            }
        }