Esempio n. 1
0
    IEnumerator requestImage(PanelAppRequest pR, string id)
    {
        int requested = 0;

        FacebookPersistentData.GetInstance().getTextureFromURL(FacebookPersistentData.GetInstance().getFriendPictureUrl(FacebookPersistentData.GetInstance().getFriendInfo(id)), delegate(Texture pictureTexture)
        {
            if (pictureTexture != null)
            {
                FacebookPersistentData.GetInstance().addFriendImage(id, pictureTexture);
                pR.addFriendPicture(pictureTexture);
            }
            requested = 1;
        });

        yield return(new WaitUntil(() => requested == 1));
    }
Esempio n. 2
0
    protected void fillData(List <string> requested, PanelAppRequest.ERequestState requestState, PanelAppRequest.EAction action, bool askedKeys = false)
    {
        GameObject      go;
        PanelAppRequest pR = null;

        for (int i = 0, j = 0; i < requested.Count; i++, j++)
        {
            string id = "";
            id = requested [i].Split('-') [1];

            if (j == 0)
            {
                go = GameObject.Instantiate(friendRequest);
                pR = go.GetComponent <PanelAppRequest> ();
                pR.setParent(panelMessages, false);
                pR.facebookManager = this;
                pR.selectRequestState(requestState);
                pR.selectAction(action);
                pR.selectTextButton();
                pR.selectImage();
            }

            pR.addIds(requested[i]);
            Texture texture = getfriendTextureByID(id);

            if (texture == null)
            {
                StartCoroutine(requestImage(pR, id));
            }
            else
            {
                pR.addFriendPicture(texture);
            }


            if (askedKeys)
            {
                if (i == requested.Count - 1 || j == maxUsersPerMessage || requested[i].Split(',')[3] != requested[i + 1].Split(',')[3])
                {
                    pR.selectText();
                }

                if (requested.Count == 1 || j == maxUsersPerMessage || requested[i].Split(',')[3] != requested[i + 1].Split(',')[3])
                {
                    j = 0;
                }
            }
            else
            {
                if (i == requested.Count - 1 || j == maxUsersPerMessage)
                {
                    pR.selectText();
                }

                if (j == maxUsersPerMessage)
                {
                    j = 0;
                }
            }
        }
    }