private void OnComplete(string response) { Debug.Log("OnComplete"); List <OnlineMapsDirectionStep> steps = OnlineMapsDirectionStep.TryParse(response); if (steps == null) { Debug.Log("Something wrong"); Debug.Log(response); return; } // Create a new marker in first point. marker = OnlineMaps.instance.AddMarker(steps[0].start, "Car"); // Gets points of route. points = OnlineMapsDirectionStep.GetPoints(steps); // Draw the route. OnlineMapsDrawingLine route = new OnlineMapsDrawingLine(points, Color.red, 3); OnlineMaps.instance.AddDrawingElement(route); pointIndex = 0; }
private void OnFindDirectionComplete(string response) { // Get the route steps. List <OnlineMapsDirectionStep> steps = OnlineMapsDirectionStep.TryParse(response); if (steps != null) { // Showing the console instructions for each step. foreach (OnlineMapsDirectionStep step in steps) { Debug.Log(step.stringInstructions); } // Get all the points of the route. List <Vector2> points = OnlineMapsDirectionStep.GetPoints(steps); // Create a line, on the basis of points of the route. OnlineMapsDrawingLine route = new OnlineMapsDrawingLine(points, Color.green); // Draw the line route on the map. OnlineMaps.instance.AddDrawingElement(route); } else { Debug.Log("Find direction failed"); } }
private void OnComplete(string response) { OnlineMaps.instance.RemoveMarkerAt(0); OnlineMaps.instance.RemoveAllDrawingElements(); OnlineMapsFindDirection.Find(fromPlace, toPlace).OnComplete -= OnComplete; List <OnlineMapsDirectionStep> steps = OnlineMapsDirectionStep.TryParse(response); if (steps == null) { Debug.Log("Something wrong"); Debug.Log(response); return; } // Create a new marker in first point. marker = OnlineMaps.instance.AddMarker(steps[0].start, "XAD"); // Gets points of route. points = OnlineMapsDirectionStep.GetPoints(steps); // Draw the route. OnlineMapsDrawingLine route = new OnlineMapsDrawingLine(points, Color.red, 1); OnlineMaps.instance.AddDrawingElement(route); OnlineMaps.instance.position = marker.position; OnlineMaps.instance.Redraw(); pointIndex = 0; }
void CheckKC(string response) { int kc = 0; List <OnlineMapsDirectionStep> steps = OnlineMapsDirectionStep.TryParse(response); if (steps != null) { kc = CaculateeKHoangCach(steps); if (kc < 5) { isIn = true; } } }
// bool isIn; void CheckKC(string response) { float kc; List <OnlineMapsDirectionStep> steps = OnlineMapsDirectionStep.TryParse(response); if (steps != null) { kc = CaculateeKHoangCach(steps); //if (kc < 5) //{ // isIn = true; //} } }
void OnDistanFindComplete(string response) { List <OnlineMapsDirectionStep> steps = OnlineMapsDirectionStep.TryParse(response); if (steps != null) { kc = CaculateeKHoangCach(steps); } int c = initCounter; GameObject obj = Instantiate(pnButtonCenter, parentPnbuttonCenter); BtnCenter bt = obj.GetComponent <BtnCenter>(); bt.Init(initCounter, Datacenter.instance.listCenter[initCounter].name, kc); obj.transform.localScale = new Vector3(1, 1, 1); bt.GetComponentInChildren <Button>().onClick.AddListener(delegate { OncenterClick(c); }); Debug.Log(initCounter); initCounter++; Sort(); }
private void OnFindDirectionGoogleComplete(string response) { // Get the route steps. List <OnlineMapsDirectionStep> steps = OnlineMapsDirectionStep.TryParse(response); if (steps != null) { directionsObj.InitRoute(steps); // Get all the points of the route. List <Vector2> points = OnlineMapsDirectionStep.GetPoints(steps); // Create a line, on the basis of points of the route. OnlineMapsDrawingLine route = new OnlineMapsDrawingLine(points, Color.green); // Draw the line route on the map. OnlineMaps.instance.AddDrawingElement(route); } else { Debug.Log("Find direction failed"); } PopupManager.Instance.HideLoading(); }