GPSPinEditor.cs 776 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. using Imagine.WebAR;
  6. namespace Imagine.WebAR.Editor{
  7. [CustomEditor(typeof(GPSPin))]
  8. public class GPSPinEditor : UnityEditor.Editor
  9. {
  10. GPSPin _target;
  11. void OnEnable(){
  12. _target = (GPSPin)target;
  13. }
  14. public override void OnInspectorGUI()
  15. {
  16. base.OnInspectorGUI();
  17. if(GUILayout.Button("Show in Google Maps")){
  18. var latitude = _target.latitude;
  19. var longitude = _target.longitude;
  20. Application.OpenURL($"https://www.google.com/maps/place/{latitude},{longitude}/@{latitude},{longitude},60m/data=!3m1!1e3?entry=ttu");
  21. }
  22. }
  23. }
  24. }