AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
LineObjectFollower.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using System.Collections;
5 using System.Collections.Generic;
6 using UnityEngine;
7 
8 namespace HoloToolkit.Unity.UX
9 {
10  [ExecuteInEditMode]
11  public class LineObjectFollower : MonoBehaviour
12  {
13  public Transform Object;
14 
15  [Header("Follow Settings")]
16  [Range(0f, 1f)]
17  public float NormalizedDistance = 0f;
18 
19  [SerializeField]
20  private LineBase source = null;
21 
22  private void Update()
23  {
24  Vector3 linePoint = source.GetPoint(NormalizedDistance);
25  Object.position = linePoint;
26  }
27  }
28 }
Vector3 GetPoint(float normalizedLength)
Gets a point along the line at the specified length
Definition: LineBase.cs:291