Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        if (carObject != null)
        {
            _OgmaNeoCar = carObject.GetComponentInChildren <OgmaNeoCarController>();

            if (_OgmaNeoCar == null || !_OgmaNeoCar.isActiveAndEnabled)
            {
                _eOgmaNeoCar = carObject.GetComponentInChildren <EOgmaNeoCarController>();
            }
        }

        _lineRenderer = GetComponentInChildren <UILineRenderer>();

        RectTransform rectTransform = _lineRenderer.GetComponent <RectTransform>();
        Rect          rect          = rectTransform.rect;

        _graphWidth  = rect.width;
        _graphHeight = rect.height;

        _graphValues = new List <float>();

        _graphPoints = new Vector2[_maxNumValues];
        for (int i = 0; i < _maxNumValues; i++)
        {
            float x = i * (_graphWidth / _maxNumValues);
            float y = 0.0f;

            _graphPoints[i].Set(x, y);
        }

        _lineRenderer.Points = _graphPoints;
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        if (carObject != null)
        {
            _OgmaNeoCar = carObject.GetComponentInChildren <OgmaNeoCarController>();

            if (_OgmaNeoCar == null || !_OgmaNeoCar.isActiveAndEnabled)
            {
                _eOgmaNeoCar = carObject.GetComponentInChildren <EOgmaNeoCarController>();
            }
        }
    }