Пример #1
0
 protected virtual void InitPainter()
 {
     m_Painter = ChartHelper.AddPainterObject("painter_b", transform, m_GraphMinAnchor,
                                              m_GraphMaxAnchor, m_GraphPivot, new Vector2(m_GraphWidth, m_GraphHeight), chartHideFlags, 1);
     m_Painter.type           = Painter.Type.Base;
     m_Painter.onPopulateMesh = OnDrawPainterBase;
     m_Painter.transform.SetSiblingIndex(0);
 }
Пример #2
0
        protected override void InitPainter()
        {
            base.InitPainter();
            if (settings == null)
            {
                return;
            }
            m_Painter.material = settings.basePainterMaterial;
            m_PainterList.Clear();
            var sizeDelta = new Vector2(m_GraphWidth, m_GraphHeight);

            for (int i = 0; i < settings.maxPainter; i++)
            {
                var index   = settings.reversePainter ? settings.maxPainter - 1 - i : i;
                var painter = ChartHelper.AddPainterObject("painter_" + index, transform, m_GraphMinAnchor,
                                                           m_GraphMaxAnchor, m_GraphPivot, sizeDelta, chartHideFlags, 2 + index);
                painter.index          = m_PainterList.Count;
                painter.type           = Painter.Type.Serie;
                painter.onPopulateMesh = OnDrawPainterSerie;
                painter.SetActive(false, m_DebugInfo.showAllChartObject);
                painter.material = settings.seriePainterMaterial;
                painter.transform.SetSiblingIndex(index + 1);
                m_PainterList.Add(painter);
            }
            m_PainterUpper = ChartHelper.AddPainterObject("painter_u", transform, m_GraphMinAnchor,
                                                          m_GraphMaxAnchor, m_GraphPivot, sizeDelta, chartHideFlags, 2 + settings.maxPainter);
            m_PainterUpper.type           = Painter.Type.Top;
            m_PainterUpper.onPopulateMesh = OnDrawPainterUpper;
            m_PainterUpper.SetActive(true, m_DebugInfo.showAllChartObject);
            m_PainterUpper.material = settings.topPainterMaterial;
            m_PainterUpper.transform.SetSiblingIndex(settings.maxPainter + 1);

            m_PainterTop = ChartHelper.AddPainterObject("painter_t", transform, m_GraphMinAnchor,
                                                        m_GraphMaxAnchor, m_GraphPivot, sizeDelta, chartHideFlags, 2 + settings.maxPainter);
            m_PainterTop.type           = Painter.Type.Top;
            m_PainterTop.onPopulateMesh = OnDrawPainterTop;
            m_PainterTop.SetActive(true, m_DebugInfo.showAllChartObject);
            m_PainterTop.material = settings.topPainterMaterial;
            m_PainterTop.transform.SetSiblingIndex(settings.maxPainter + 1);
        }