Esempio n. 1
0
    public void updateViews()
    {
        int c = this.frames.Count;

        for (int i = 0; i < c; ++i)
        {
            //Renderer rend = this.frames [i].GetComponent<Renderer> ();
            //Person p = getRandomPerson ();

            Debug.Log("log testing " + i);

            //rend.material.mainTexture = rick;
            //rend.material.mainTexture = getRandomPerson ().getRandomPost ().content;

            //
            Post last = getRandomPerson().getRandomPost();
            int  j = 0, k = 0;

            foreach (Transform child in frames[i].transform)
            {
                if (child.CompareTag("comment"))
                {
                    textToSurface script = child.GetComponents <textToSurface> ()[0];
                    script.updateText(last.comments[j][1]);
                    ++j;
                }
                else if (child.CompareTag("Pic"))
                {
                    last = getRandomPerson().getRandomPost();
                    j    = 0;

                    child.GetComponent <Renderer> ().material.mainTexture = last.content;
                }
            }
        }
    }