Projekt

Obecné

Profil

Stáhnout (829 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
using UnityEngine;
2

    
3
namespace DeltaRobotVr.Components
4
{
5
    public class Curve : MonoBehaviour
6
    {
7
        private long _currentCounter;
8
        private LineRenderer _lineRenderer;
9
        
10
        void Start()
11
        {
12
            _currentCounter = Client.Instance.CurveCounter;
13
            _lineRenderer = GetComponent<LineRenderer>();
14
        }
15
   
16
        void Update()
17
        {
18
            if (Client.Instance.IsConnected)
19
            {
20
                var counter = Client.Instance.CurveCounter;
21
                if(counter != _currentCounter && Client.Instance.Curve != null)
22
                {
23
                    _lineRenderer.positionCount = Client.Instance.Curve.Length;
24
                    _lineRenderer.SetPositions(Single3Utils.ToVector3(Client.Instance.Curve));
25
                }
26
            }
27
        }
28
    }
29
}
(7-7/14)