public void CerrarSesion() { TI_API.CerrarSesion(); Hide(); loginScreen.Show(); }
public void Ingresar() { error.gameObject.SetActive(false); try { usuario.interactable = false; password.interactable = false; StartCoroutine(TI_API.LoginRequest(usuario.text, password.text, LoginSuccess, LoginError)); } catch (ArgumentException) { error.text = "Error de conexión con el servidor"; error.gameObject.SetActive(true); throw; } catch (Exception) { error.text = "Error de conexión con el servidor"; error.gameObject.SetActive(true); throw; } }
public void Show(int id) { txtTitle.text = TI_API.GetStudy(id).name + " - " + TI_API.GetStudy(id).date; btn3D.interactable = TI_API.GetStudy().off_url != null; btnVR.interactable = TI_API.GetStudy().off_url != null; btnPDF.interactable = TI_API.GetStudy().pdf_url != null; descargandoContainer.SetActive(false); gameObject.SetActive(true); }
private void LoginSuccess() { usuario.interactable = true; password.interactable = true; PlayerPrefs.SetString("Email", usuario.text); Debug.Log(usuario.text + " " + PlayerPrefs.GetString("Email")); StartCoroutine(TI_API.RequestManagedCorporations(CallbackCorporation)); }
private IEnumerator LoadImage() { string url = null; if (TI_API.GetSubdependencie().images != null) { url = TI_API.GetSubdependencie().images[0].imageUrl; } if (url != null) { //WWWForm form = new WWWForm(); //form.AddField("email", _usuario); //form.AddField("password", _password); UnityWebRequest img = UnityWebRequestTexture.GetTexture(url.ToString()); //WWW img = new WWW(url); Debug.Log("Downloading Image"); Debug.Log("URL: " + url.ToString()); yield return(img.Send()); if (img.isNetworkError || img.isHttpError) { string msg = ""; Debug.LogError("Download error: " + img.error); if (img.isNetworkError) { msg = "Error de conexión con el servidor"; } } else { DebugUnity.Log("Scale Download Successful!"); DebugUnity.Log("Scale response: " + img.downloadHandler.text); } Debug.Log(img.downloadedBytes); Debug.Log(img.downloadedBytes.ToString()); //Texture a = new Texture(); DownloadHandlerTexture handler = (DownloadHandlerTexture)img.downloadHandler; Sprite sprt = Sprite.Create(handler.texture, new Rect(0, 0, handler.texture.width, handler.texture.height), new Vector2(0.5f, 0.5f)); scaleView.sprite = sprt; scaleView.gameObject.SetActive(true); } else { Debug.LogWarning("No image attached"); scaleView.gameObject.SetActive(false); yield return(null); } }
public override void CargarLista(int id) { base.CargarLista(id); DebugUnity.Log("Load Corporations."); for (int i = 0; i < TI_API.CorporationsCount; i++) { AddBoton(TI_API.GetCorporation(i).name, i); } }
public override void CargarLista(int id) { base.CargarLista(id); Enterprise enterprise = TI_API.GetEnterprise(myIndex); DebugUnity.Log("Load dependencie: [" + myIndex + "] " + enterprise.name); if (enterprise.dependencies != null) { for (int i = 0; i < enterprise.dependencies.Length; i++) { AddBoton(enterprise.dependencies[i].name, i); } } }
public override void CargarLista(int id) { base.CargarLista(id); Corporation corporation = TI_API.GetCorporation(myIndex); DebugUnity.Log("Load Enterprises: [" + myIndex + "] " + corporation.name); if (corporation.enterprises != null) { for (int i = 0; i < corporation.enterprises.Length; i++) { AddBoton(corporation.enterprises[i].name, i); } } }
public override void CargarLista(int id) { base.CargarLista(id); Subdependencie subdependencie = TI_API.GetSubdependencie(myIndex); DebugUnity.Log("Load Studies: [" + myIndex + "] " + subdependencie.name); if (subdependencie.studies != null) { for (int i = 0; i < subdependencie.studies.Length; i++) { ElementoLista el = AddBoton(subdependencie.studies[i].name + " " + subdependencie.studies[i].date + (!string.IsNullOrEmpty(subdependencie.studies[i].off_url) ? " (Scan)" : "") + (!string.IsNullOrEmpty(subdependencie.studies[i].pdf_url) ? " (PDF)" : ""), i); el.elegirEntregable = elegirEntregable; } } }
public override void CargarLista(int id) { base.CargarLista(id); Dependencie dependencie = TI_API.GetDependencie(myIndex); DebugUnity.Log("Load Subdependencie: [" + myIndex + "] " + dependencie.name); if (dependencie.subdependencies != null) { for (int i = 0; i < dependencie.subdependencies.Length; i++) { int a = dependencie.subdependencies[i].studies != null ? dependencie.subdependencies[i].studies.Length : 0; AddBoton(dependencie.subdependencies[i].name, i); } } }
public void CheckScale() { string url = null; if (TI_API.GetSubdependencie().images != null) { url = TI_API.GetSubdependencie().images[0].imageUrl; } if (url == null) { txtNoScale.SetActive(true); } else { txtNoScale.SetActive(false); } }
public void BtnPDF() { StartDownload(); StartCoroutine(TI_API.DownloadPDF(PdfSuccess, ErrorCallback)); }
public void BtnVR() { StartDownload(); StartCoroutine(TI_API.DownloadOFF(OffSuccessVR, ErrorCallback)); }