Exemplo n.º 1
0
        public void InitPlotterChild(String name, Texture2D blankGraph, float min, float max, Color plotColor, Plotter parent)
        {
            this.name      = name;
            this.plotColor = plotColor;

            minValue   = min;
            maxValue   = max;
            gridHeight = parent.grid.height;
            gridWidth  = parent.grid.width;

            data = new int[gridWidth];

            floor = 0;
            top   = gridHeight + Mathf.RoundToInt(gridHeight * 0.17f) + floor;

            scale = (max - min) / top;

            if (max > 0 && min < 0)
            {
                zeroLine = (int)((-minValue) / scale) + floor;
            }

            child       = true;
            this.Parent = parent;

            parent.AddChild(this);
        }
Exemplo n.º 2
0
        public void InitPlotterChild(String name, Texture2D blankGraph, float min, float max, Color plotColor, Plotter parent)
        {
            this.name = name;
            this.plotColor = plotColor;

            minValue = min;
            maxValue = max;
            gridHeight = parent.grid.height;
            gridWidth = parent.grid.width;

            data = new int[gridWidth];

            floor = 0;
            top = gridHeight + Mathf.RoundToInt(gridHeight * 0.17f) + floor;

            scale = (max - min) / top;

            if (max > 0 && min < 0) zeroLine = (int)((-minValue) / scale) + floor;

            child = true;
            this.Parent = parent;

            parent.AddChild(this);
        }