Projekt

Obecné

Profil

Stáhnout (765 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
using System.Collections;
2
using System.Collections.Generic;
3
using UnityEngine;
4
using DeltaRobotVr;
5

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