Ejemplo n.º 1
0
    void Update()
    {
        if (levelID < 1)
        {
            return;
        }
        if (loaded)
        {
            return;
        }

        //if (!SocialManager.Instance.userHiscore.isLoaded) return;

        //if (SocialManager.Instance.facebookFriends.all.Count==0) return;

        if (SocialManager.Instance.ranking.levels[levelID - 1].data.Count > 0)
        {
            //SocialEvents.OnRefreshRanking();
            loaded = true;
            foreach (Transform childTransform in container.transform)
            {
                Destroy(childTransform.gameObject);
            }

            foreach (Ranking.RankingData data in SocialManager.Instance.ranking.levels[levelID - 1].data)
            {
                RankingButton newButton = Instantiate(button);

                newButton.transform.SetParent(container.transform);
                newButton.Init(data.facebookID, data.score, data.playerName);

                newButton.transform.localScale = Vector2.one;

                if (data.isYou)
                {
                    newButton.IsYou();
                }
            }
        }
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (loaded)
        {
            return;
        }

        if (!SocialManager.Instance.userHiscore.isLoaded)
        {
            return;
        }

        if (SocialManager.Instance.facebookFriends.all.Count == 0)
        {
            return;
        }

        if (SocialManager.Instance.ranking.data.Count > 0)
        {
            SocialEvents.OnRefreshRanking();
            loaded = true;
            foreach (Ranking.RankingData data in  SocialManager.Instance.ranking.data)
            {
                RankingButton newButton = Instantiate(button);

                newButton.transform.SetParent(container.transform);
                newButton.Init(data.facebookID, data.score, data.playerName);

                newButton.transform.localScale = Vector2.one;

                if (data.isYou)
                {
                    newButton.IsYou();
                }
            }
        }
    }