AR + GPS Location  3.0.0
All Classes Namespaces Functions Variables Properties Events Pages
RenderPathLine.cs
1 using System;
2 using UnityEngine;
3 using UnityEngine.Serialization;
4 
5 namespace ARLocation
6 {
7  using Utils;
8 
12  [AddComponentMenu("AR+GPS/Render Path Line")]
13  [HelpURL("https://http://docs.unity-ar-gps-location.com/guide/#renderpathline")]
14  public class RenderPathLine : MonoBehaviour
15  {
16  public MoveAlongPath.PathSettingsData PathSettings;
17  public MoveAlongPath.PlacementSettingsData PlacementSettings;
18  private Transform arLocationRoot;
19 
20  public void Start()
21  {
22  if (PathSettings.LineRenderer == null)
23  {
24  var lineRenderer = gameObject.GetComponent<LineRenderer>();
25 
26  if (!lineRenderer)
27  {
28  throw new NullReferenceException("[AR+GPS][RenderPathLine#Start]: No Line Renderer!");
29  }
30 
31  PathSettings.LineRenderer = lineRenderer;
32  }
33 
34  arLocationRoot = ARLocationManager.Instance.gameObject.transform;
35 
36  var pathGameObject = new GameObject($"{gameObject.name} - RenderPathLine");
37 
38  var moveAlongPath = pathGameObject.AddComponent<MoveAlongPath>();
39  moveAlongPath.PathSettings = PathSettings;
40  moveAlongPath.PlacementSettings = PlacementSettings;
41  }
42  }
43 }
ARLocation.MoveAlongPath.PlacementSettingsData
Definition: MoveAlongPath.cs:74
ARLocation.MoveAlongPath.PathSettingsData
Definition: MoveAlongPath.cs:21
ARLocation.ARLocationManager
This Component manages all positioned GameObjects, synchronizing their world position in the scene wi...
Definition: ARLocationManager.cs:30
ARLocation.MoveAlongPath
This component, when attached to a GameObject, makes it traverse a path that interpolates a given set...
Definition: MoveAlongPath.cs:18
ARLocation.Utils.Singleton.Instance
static T Instance
Access singleton instance through this propriety.
Definition: Singleton.cs:18
ARLocation.RenderPathLine
This component renders a LocationPath using a given LineRenderer.
Definition: RenderPathLine.cs:15
ARLocation
Definition: ARLocationConfigInspector.cs:7