Exemplo n.º 1
0
        private void InstantiateViews()
        {
            labelText = viewCreator.InstantiateText("label", transform, PivotValue.MIDDLE_LEFT);
            labelText.GetComponent <RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
            labelText.GetComponent <RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
            labelText.GetComponent <RectTransform>().sizeDelta = new Vector2(300f, 40f);

            lineRenderer = viewCreator.InstantiateLineRenderer("line", transform, PivotValue.CENTER);
            lineRenderer.GetComponent <RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
            lineRenderer.GetComponent <RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
            lineRenderer.lineThickness = 2.0f;
        }
        private void InstantiateViews()
        {
            labelText = viewCreator.InstantiateWithPrefab <ChartLabel> (labelPrafab, transform);
            labelText.GetComponent <RectTransform> ().anchorMin = new Vector2(0.5f, 0.5f);
            labelText.GetComponent <RectTransform> ().anchorMax = new Vector2(0.5f, 0.5f);
            labelText.GetComponent <RectTransform> ().sizeDelta = new Vector2(300f, 40f);

            lineRenderer = viewCreator.InstantiateLineRenderer("line", transform, PivotValue.CENTER);
            lineRenderer.GetComponent <RectTransform> ().anchorMin = new Vector2(0.5f, 0.5f);
            lineRenderer.GetComponent <RectTransform> ().anchorMax = new Vector2(0.5f, 0.5f);
            lineRenderer.lineThickness = 2.0f;
        }