public void updatePOILocation(int newPOIid) { currentPOIid = newPOIid; double a = DI.DrawCubeX(ListPOI[currentPOIid].Long, DI.TileToWorldPos(DI.x, DI.y, DI.zoom).X, DI.TileToWorldPos(DI.x + 1, DI.y, DI.zoom).X); double b = DI.DrawCubeY(ListPOI[currentPOIid].Lat, DI.TileToWorldPos(DI.x, DI.y + 1, DI.zoom).Y, DI.TileToWorldPos(DI.x, DI.y, DI.zoom).Y); currentPOI.transform.position = new Vector3((float)a, (float)b, currentPOI.transform.position.z); }
// Update is called once per frame void Update() { float Long = defaultLon; float Lat = defaultLat; if (GPSLinkActive) { Long = Input.location.lastData.longitude; Lat = Input.location.lastData.latitude; } double a = DI.DrawCubeX(Long, DI.TileToWorldPos(DI.x, DI.y, DI.zoom).X, DI.TileToWorldPos(DI.x + 1, DI.y, DI.zoom).X); double b = DI.DrawCubeY(Lat, DI.TileToWorldPos(DI.x, DI.y + 1, DI.zoom).Y, DI.TileToWorldPos(DI.x, DI.y, DI.zoom).Y); gameObject.transform.position = new Vector3((float)a, (float)b, gameObject.transform.position.z); }