Esempio n. 1
0
        void SetAndRefresh(Communication.Proto.Leaderboard leaderboard)
        {
            _leaderboard = leaderboard;

            for (int i = 0; i < Count; i++)
            {
                if (i < _leaderboard.ItemList.Count)
                {
                    if (_leaderboardSlots[i] == null)
                    {
                        var go = PrefabHelper.InstantiateAndReset(MySlot.gameObject, Grid.transform);
                        go.name = "Slot " + i;
                        _leaderboardSlots[i] = go.GetComponent <LeaderboardSlot>();
                    }
                    if (_leaderboardSlots[i] != null)
                    {
                        _leaderboardSlots[i].gameObject.SetActive(true);
                        _leaderboardSlots[i].SetAndRefresh(_leaderboard.ItemList[i]);
                    }
                }
                else
                {
                    if (_leaderboardSlots[i] != null)
                    {
                        _leaderboardSlots[i].gameObject.SetActive(false);
                    }
                }
            }
            Grid.repositionNow = true;

            MySlot.SetAndRefresh(_leaderboard.MyItem);
        }
Esempio n. 2
0
 public void Execute(Communication.Proto.Leaderboard cmd)
 {
     SetAndRefresh(cmd);
 }