Пример #1
0
    private void GenerateAxisLabels()
    {
        labelDelegate = new BasicAxisLabelDelegate(AttributeFilter, visualisationReference.dataSource);

        List <GameObject> children = new List <GameObject>();

        foreach (Transform child in axisValueLabels.transform)
        {
            if (child.gameObject.activeSelf)
            {
                children.Add(child.gameObject);
            }
        }
        foreach (GameObject go in children)
        {
            DestroyImmediate(go);
        }

        axisLabels.Clear();

        for (int i = 0; i < labelDelegate.NumberOfLabels(); ++i)
        {
            var go = Instantiate(axisLabelPrefab, axisValueLabels.transform);
            go.gameObject.SetActive(true);

            go.text = labelDelegate.LabelText(i);
            SetYPos(go.transform, labelDelegate.LabelPosition(i));

            axisLabels.Add(go);
        }
    }
Пример #2
0
    private void UpdateAxisLabels()
    {
        labelDelegate = new BasicAxisLabelDelegate(AttributeFilter, visualisationReference.dataSource);

        for (int i = 0; i < labelDelegate.NumberOfLabels(); ++i)
        {
            var go = axisLabels[i];
            go.text = labelDelegate.LabelText(i);

            float y = labelDelegate.LabelPosition(i);
            SetYPos(go.transform, y * Length);
            go.gameObject.SetActive(y >= 0.0f && y <= 1.0f);

            go.color = new Color(1, 1, 1, labelDelegate.IsFiltered(i) ? 0.4f : 1.0f);
        }
    }