Ejemplo n.º 1
0
        private void Awake()
        {
            LastTrainPos         = transform.position;
            _achievementsService = ServiceLocator.GetService <AchievementsService>();
            _audioService        = ServiceLocator.GetService <AudioService>();
            _levelService        = ServiceLocator.GetService <LevelService>();
            _adsService          = ServiceLocator.GetService <AdsService>();
            _skinService         = ServiceLocator.GetService <SkinService>();
            _gameDataService     = ServiceLocator.GetService <GameDataService>();
            _uiService           = ServiceLocator.GetService <UIService>();
            _poolService         = ServiceLocator.GetService <PoolService>();

            Trains          = new List <TrainController>();
            spriteRenderer  = GetComponent <SpriteRenderer>();
            TargetPointList = TargetRail.WayPoints;
            TargetPoint     = TargetPointList[0].localPosition;
            Trains.Add(this);

            InputManager.Swipe      += InputManagerOnSwipe;
            _adsService.TrainRevive += ReviveTrain;
            _uiService.GameRestart  += ResetTrain;

            _skinService.UpdateSkin(spriteRenderer);
            UpdateTrainPoints();
            LockControlls = _uiService.IsFirstTime;
            IsFirstTime   = _uiService.IsFirstTime;
        }