private IEnumerator downloadCloseGlyphs(GPSLocation newLocation) { Debug.LogError(downloadedGlyphs.ContainsKey(newLocation)); if (!downloadedGlyphs.ContainsKey(newLocation)) { downloadedGlyphs.Add(newLocation, null); // reserve key while (LoggedInUser.GetLoggedInUser() == null) { Debug.LogWarning("GPS updated but no user logged in. Waiting to download."); yield return(new WaitForSeconds(1.0f)); } GPSLocation[] closeBounds = newLocation.calculateLatLongBoundingBox(GlyphUniverse.MAX_RENDER_DISTANCE); ServerCall call = new ServerCall(ServerInteract.INSTANCE.GetGlyphsInArea(closeBounds)); yield return(StartCoroutine(call.call())); if (call.ReturnException != null) { Debug.LogException(call.ReturnException); } else { List <Glyph> closeGlyphs = (List <Glyph>)call.ObjectResponse; if (closeGlyphs.Count == 0) { fireGlyphDownloadedListeners(null); } else { foreach (Glyph glyph in closeGlyphs) { fireGlyphDownloadedListeners(glyph); } downloadedGlyphs [newLocation] = closeGlyphs; } } } yield return("Done"); }