Projekt

Obecné

Profil

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

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