Exemplo n.º 1
0
    private void GetArtifactInfo(string id)
    {
        string d = "";

        if (PlayerPrefs.GetString("localization") == "ilocano")
        {
            d    = "Nangited";
            date = "Naala idi tawen ";
        }
        else
        {
            d    = "Donated by";
            date = "Date Acquired ";
        }
        list          = ArtmoLoader.GetDetails(Convert.ToInt32(id));
        txtGTerm.text = list[3];
        txtName.text  = list[2];

        txtDonor.text = (list[5].Length > 1)?d + " : " + list[5]:"";
        date          = date + " " + list[6].Substring(0, 4);
        if (date.Contains("0001"))
        {
            date = "";
        }
        txtDescription.text = "\t" + list[4] + " " + date;
        var       img  = Convert.FromBase64String(list[1]);
        Texture2D text = new Texture2D(2, 2);

        text.LoadImage(img);
        Sprite sprite = Sprite.Create(text, new Rect(0, 0, text.width, text.height), new Vector2(.5f, .5f));

        sprite.name = "artifactImage";
        artifactImage.GetComponent <Image>().sprite = sprite;
    }
Exemplo n.º 2
0
    private void AddArtifactButtons()
    {
        ArtmoModel        model = new ArtmoModel();
        List <ArtmoModel> list  = ArtmoLoader.GetListByMarker(id);

        for (int i = 0; i < list.Count; i++)
        {
            model = list[i];
            GameObject newBtn = btnObjectPool.GetObject();

            newBtn.transform.SetParent(contentPanel);

            ButtonArtifacts buttonArtifacts = newBtn.GetComponent <ButtonArtifacts>();

            buttonArtifacts.Setup(model);
        }
    }
Exemplo n.º 3
0
    private void GetNone3D(int markerID)
    {
        //getting base 64 image
        var item = ArtmoLoader.GetListByMarker(markerID);

        if (item.Count > 0)
        {
            loadedObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
            noItem    = false;
            for (var i = c; i < item.Count; i++)
            {
                ArtmoModel model = item[i];
                if (model.Image.Length > 10)
                {
                    Debug.Log(model.Image);
                    Texture2D tex = new Texture2D(2, 2);
                    tex.LoadImage(System.Convert.FromBase64String(model.Image));
                    loadedObj.GetComponent <MeshRenderer> ().material.mainTexture = tex;
                    loadedObj.transform.Rotate(0, 90, 0);
                    break;
                }
            }
            if (c + 1 == item.Count)
            {
                c = -1;
            }
        }
        else
        {
            //if there is no items in marker
            btnMore.gameObject.SetActive(false);
            nodata.gameObject.SetActive(true);
            noItem = true;
            c      = -1;
        }
    }