using Demonics.UI; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class ReplaysMenu : BaseMenu { [SerializeField] private BaseMenu _replayIncompatibleMenu = default; [SerializeField] private RectTransform _scrollView = default; [SerializeField] private RectTransform _replaysGroup = default; [SerializeField] private GameObject _replayPrefab = default; [SerializeField] private GameObject _noReplaysFound = default; private readonly List _replayCards = new(); private ReplayCard _currentReplayCard; void Start() { _replaysGroup.anchoredPosition = new Vector2(0.0f, _replaysGroup.anchoredPosition.y); if (ReplayManager.Instance.ReplayAmount > 1) { for (int i = 0; i < ReplayManager.Instance.ReplayAmount - 1; i++) { ReplayCard replayCard = Instantiate(_replayPrefab, _replaysGroup).GetComponent(); replayCard.SetData(ReplayManager.Instance.GetReplayData(i)); int index = i; replayCard.GetComponent()._onClickedAnimationEnd.AddListener(() => LoadReplayMatch(index)); replayCard.GetComponent()._scrollView = _scrollView; _replayCards.Add(replayCard); } _replayCards[0].GetComponent()._scrollUpAmount = 0.0f; _replayCards[_replayCards.Count - 1].GetComponent()._scrollDownAmount = 0.0f; _replayCards[0].GetComponent