Projekt

Obecné

Profil

« Předchozí | Další » 

Revize f4e5d893

Přidáno uživatelem Oto Šťáva před téměř 4 roky(ů)

Re #8900 - Refactor

Zobrazit rozdíly:

deltarobot-vr/Assets/DeltaRobotVr/ArrowScript.cs
1
using System.Collections;
2
using System.Collections.Generic;
3 1
using UnityEngine;
4
using DeltaRobotVr;
5 2

  
6
public abstract class ArrowScript : MonoBehaviour
3
namespace DeltaRobotVr
7 4
{
8
    protected LineRenderer lr;
9
    void Start()
5
    public abstract class ArrowScript : MonoBehaviour
10 6
    {
11
        lr = GetComponent<LineRenderer>();
12
    }
7
        protected LineRenderer lr;
8
        void Start()
9
        {
10
            lr = GetComponent<LineRenderer>();
11
        }
13 12

  
14
    void Update()
15
    {
16
        if (Client.Instance.IsConnected)
13
        void Update()
17 14
        {
18
            var vector = getVector();
19
            lr.SetPositions(new Vector3[] { Vector3.zero, MyTools.Single3Transform(vector.X, vector.Y, vector.Z) * 2 });
15
            if (Client.Instance.IsConnected)
16
            {
17
                var vector = GetVector();
18
                lr.SetPositions(new[] { Vector3.zero, Single3Utils.ToVector3(vector) * 2 });
19
            }
20 20
        }
21
    }
22 21

  
23
    protected abstract Single3 getVector();
22
        protected abstract Single3 GetVector();
23
    }
24 24
}

Také k dispozici: Unified diff