示例#1
0
        private LeaderboardCell CreateLeaderboardCell(Transform in_parent = null, bool isYou = false)
        {
            LeaderboardCell toReturn = null;

            toReturn = (GEntityFactory.Instance.CreateResourceAtPath(isYou ? "Prefabs/UI/leaderboardCellYou" : "Prefabs/UI/leaderboardCell", in_parent.transform)).GetComponent <LeaderboardCell>();
            toReturn.transform.SetParent(in_parent);
            toReturn.transform.localScale = Vector3.one;
            return(toReturn);
        }
示例#2
0
        private void PopulateLeaderboardScrollView(List <PlayerData> in_leaderboardItems, List <LeaderboardCell> in_leaderboardCell, RectTransform in_scrollView)
        {
            RemoveAllCellsInView(in_leaderboardCell);
            if (in_leaderboardItems.Count == 0)
            {
                return;
            }

            if (in_scrollView != null)
            {
                List <PlayerData> activeListData = in_leaderboardItems;
                for (int i = 0; i < activeListData.Count; ++i)
                {
                    LeaderboardCell newItem = CreateLeaderboardCell(in_scrollView, GCore.Wrapper.Client.ProfileId == activeListData[i].ProfileId);
                    newItem.Init(activeListData[i]);
                    newItem.transform.localPosition = Vector3.zero;
                    in_leaderboardCell.Add(newItem);
                }
            }
        }