private IEnumerator AsyncOpenDocument(DocumentsGetDocumentsResponse200Items doc) { ShowProgress("Loading workspace..."); _currentWorkspace = doc.DefaultWorkspace.Id; _currentDocument = doc.Id; _currentElement = null; var request = ApiClient.Instance.Documents.GetElementList("w", doc.Id, _currentWorkspace, "PARTSTUDIO", null, true); yield return(request.CallApi()); if (!request.OK) { LogError("Unable to retrieve document tab list"); yield break; } foreach (var reponse in request.Response) { var imgReq = new ImageRequest(reponse.ThumbnailInfo.Sizes[0].Href, Method.GET, new Dictionary <string, string>(), null, true); yield return(imgReq.CallApi()); if (imgReq.Image == null) { LogError("Unable to get image : " + reponse.ThumbnailInfo.Href); } else { reponse.ThumbnailInfo.Image = imgReq.Image; } } var selectedTab = request.Response?[0]; MenuDocument.RefreshTabList(request.Response, selectedTab); OpenTab(selectedTab); Workspace.gameObject.transform.position = MenuDocument.gameObject.transform.position + new Vector3(0, -0.5f, -0.5f); }
public void OpenDocument(DocumentsGetDocumentsResponse200Items doc) { SelectFace(null); StartCoroutine(AsyncOpenDocument(doc)); }