private void GetMainUserFromServer() { System.Array array = System.Enum.GetValues(typeof(PlayerDTO.Avatars)); PlayerDTO.Avatars avatar = (PlayerDTO.Avatars)array.GetValue(Random.Range(0, array.Length)); array = System.Enum.GetValues(typeof(PlayerDTO.Statuses)); PlayerDTO.Statuses status = (PlayerDTO.Statuses)array.GetValue(Random.Range(0, array.Length)); _ui.SetStatus(status.ToString()); _mainUser.SetData(new PlayerDTO("Evgenius", Random.Range(0, 30000), Random.Range(0, 25000), Random.Range(0, 20000), avatar.ToString(), status.ToString()), _currentDifficulty, false); }
private void SetDataToUsers() { TopUser user = null; RectTransform rect = null; _usersPool.ReturnAllItemsToPool(); for (int i = 0; i < topCount; i++) { user = _usersPool.GetItemFromPool(); if (user == null) { return; } user.SetData(_currentList[i], _currentDifficulty, true); user.SetIndex(i + 1); rect = user.GetComponent <RectTransform>(); rect.localPosition = new Vector3(0, rect.localPosition.y - (_ui.TableCellHeight * (user.Index - 1)), 0); user.Activate(user.transform.position); } _ui.ChangeTableHeight(_currentList.Count > topCount ? topCount : _currentList.Count); _ui.ChangeScrollValue(CalculateScrollValue()); }