示例#1
0
        private void Awake()
        {
            _uiService           = ServiceLocator.GetService <UIService>();
            _playGamesService    = ServiceLocator.GetService <PlayGamesService>();
            _skinService         = ServiceLocator.GetService <SkinService>();
            _achievementsService = ServiceLocator.GetService <AchievementsService>();

            _skinsList = new List <SkinButton>();
            _getRandomSkin.onClick.AddListener(GetRandomSkin);
            _pages.ForEach(page => _skinsList.AddRange(page.GetComponentsInChildren <SkinButton>()));
            _skinService.UpdateSelectedTrainPreview += UpdateSelectedPreview;
            UpdateSkins();
            _selectedTrainPreview.sprite = _skinService.GetCurrentSkin();
        }