private void RemoveLeaderboardItems() { if (_listLeaderboardItems == null) { return; } for (int i = 0; i < _listLeaderboardItems.Length; i++) { Destroy(_listLeaderboardItems[i]); _listLeaderboardItems[i] = null; } _baseLeaderboardItem.GetComponent <CanvasGroup>().alpha = 0; }
public void RpcUpdatePositions(bool skipAnim) { if (currentLeaderboardSequence != null && currentLeaderboardSequence.IsPlaying()) { currentLeaderboardSequence.Kill(); } players = players.OrderBy(i => - i.Score).ToList(); currentLeaderboardSequence = DOTween.Sequence(); for (int i = 0; i < players.Count; i++) { LeaderboardItem currentPlayer = players[i]; float newYPosition = GetPositionYOnLeaderboard(i); currentLeaderboardSequence.Insert(0, currentPlayer.GetComponent <RectTransform>().DOAnchorPosY(newYPosition, skipAnim ? 0 : listMovementDuration)); } currentLeaderboardSequence.Play(); }