private void ActionOnClick(CarCard card) { if (_currentCard == card) { return; } _currentCard.Select(false); _currentCard = card; _currentCard.Select(true); }
public override void Start() { var i = 0; foreach (var car in _carsInfo.CarInfos) { var carCard = _factory.Create(); carCard.transform.SetParent(carsTransform); // carCard.SetInfo(car, i, ActionOnClick); // carCard.Select(false); // if (!_currentCard || i == Scores.Instance.SelectedCar) { _currentCard = carCard; } i++; } // _currentCard.Select(true); }