Exemplo n.º 1
0
    public void CerrarSesion()
    {
        TI_API.CerrarSesion();

        Hide();
        loginScreen.Show();
    }
Exemplo n.º 2
0
    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;
        }
    }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
    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));
    }
Exemplo n.º 5
0
    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);
        }
    }
Exemplo n.º 6
0
    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);
        }
    }
Exemplo n.º 7
0
    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);
            }
        }
    }
Exemplo n.º 8
0
    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);
            }
        }
    }
Exemplo n.º 9
0
    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;
            }
        }
    }
Exemplo n.º 10
0
    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);
            }
        }
    }
Exemplo n.º 11
0
    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);
        }
    }
Exemplo n.º 12
0
    public void BtnPDF()
    {
        StartDownload();

        StartCoroutine(TI_API.DownloadPDF(PdfSuccess, ErrorCallback));
    }
Exemplo n.º 13
0
 public void BtnVR()
 {
     StartDownload();
     StartCoroutine(TI_API.DownloadOFF(OffSuccessVR, ErrorCallback));
 }