private void Awake() { keyPoints = new List <Vector3>(); totalDistance = 0; AddPoint(Vector3.zero); if (useRealPath) { GPSConverter coordConverter = GetComponent <GPSConverter>(); List <Vector3> gpsCoords = coordConverter.GetPathPoints(); Debug.Log("Number of gps points: " + gpsCoords.Count); for (int i = 0; i < gpsCoords.Count; i++) { Vector3 coord = gpsCoords[i]; Debug.Log("Coord: " + coord); coord = Vector3.right * coord.magnitude; AddPoint(coord); //GameObject pickup = Instantiate<GameObject>(pickupPrefab); //pickup.transform.position = coord; } } else { AddPoint(300 * Vector3.right); } }
static void Main(string[] args) { if (GPSConverter.DeviceGPSToBaiduGPS("iAe652kYOgleRHUYQkW1E8MIHEptnMb5", 120.379235583333, 36.19172925, out double x, out double y)) { Console.WriteLine($"120.379235583333 - 36.19172925"); Console.WriteLine($"{x} - {y}"); } http: //api.map.baidu.com/geocoder/v2/?location=36.1981373852607,120.390842831702&output=json&ak=iAe652kYOgleRHUYQkW1E8MIHEptnMb5 Console.ReadLine(); }
static void Main(string[] args) { if (GPSConverter.DeviceGPSToBaiduGPS("iAe652kYOgleRHUYQkW1E8MIHEptnMb5", 120.379235583333, 36.19172925, out double x, out double y)) { Console.WriteLine($"120.379235583333 - 36.19172925"); Console.WriteLine($"{x} - {y}"); } GPSInfoWebModel model = GPSInfoTool.GetInfo("iAe652kYOgleRHUYQkW1E8MIHEptnMb5", 40.039669, 252.129464); if (model != null) { GPSInfoModel info = model.ToGPSInfoModel(); Console.WriteLine(info); } Console.ReadLine(); }