2 using System.Collections.Generic;
4 using UnityEngine.Serialization;
16 [AddComponentMenu(
"AR+GPS/Place At Locations")]
17 [HelpURL(
"https://http://docs.unity-ar-gps-location.com/guide/#placeatlocations")]
27 [Tooltip(
"The locations where the objects will be instantiated.")]
35 [FormerlySerializedAs(
"prefab")] [Tooltip(
"The game object that will be instantiated.")]
41 [Tooltip(
"When debug mode is enabled, this component will print relevant messages to the console. Filter by 'PlateAtLocations' in the log output to see the messages.")]
42 public bool DebugMode;
46 private readonly List<Location> locations =
new List<Location>();
47 private readonly List<GameObject> instances =
new List<GameObject>();
49 public List<GameObject> Instances => instances;
53 foreach (var entry
in Locations)
55 var newLoc = entry.GetLocation();
61 public void AddLocation(Location location)
63 var instance = PlaceAtLocation.CreatePlacedInstance(
Prefab, location, PlacementOptions, DebugMode);
65 instance.name = $
"{gameObject.name} - {locations.Count}";
67 locations.Add(location);
68 instances.Add(instance);