LocationData.cs 922 B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. using UnityEngine.Serialization;
  3. namespace ARLocation
  4. {
  5. /// <summary>
  6. /// Data used to construct a spline passing trough a set of geographical
  7. /// locations.
  8. /// </summary>
  9. [CreateAssetMenu(fileName = "AR Location Data", menuName = "AR+GPS/Location")]
  10. public class LocationData : ScriptableObject
  11. {
  12. /// <summary>
  13. /// The geographical locations that the path will interpolate.
  14. /// </summary>
  15. [FormerlySerializedAs("location")] [Tooltip("The geographical locations that the path will interpolate.")]
  16. public Location Location;
  17. public static LocationData FromLocation(Location location) {
  18. var data = CreateInstance<LocationData>();
  19. data.Location = location;
  20. return data;
  21. }
  22. public override string ToString()
  23. {
  24. return Location.ToString();
  25. }
  26. }
  27. }