Ejemplo n.º 1
0
 public void GetLeaderBoard()
 {
     if (_getPosition != null)
     {
         _asyncProcessor.StopCoroutine(_getPosition);
         _getPosition = null;
     }
     _getPosition = _asyncProcessor.StartCoroutine(GetLeaderBoardCoroutine());
 }
Ejemplo n.º 2
0
 public void OnLevelStart(LevelStartSignal signal)
 {
     if (!_levelConfig.startAnimationEnabled)
     {
         return;
     }
     _asyncProcessor.StartCoroutine(PlayPlayerAnimation());
     _asyncProcessor.StartCoroutine(PlayUIAnimation());
 }
Ejemplo n.º 3
0
 public EnemySpawner(UnityPoolManager <Enemy, EnemyView> enemyPool, AsyncProcessor asyncProcessor,
                     Settings settings, IScreenSize screenSize, Camera camera, IElementSize size)
 {
     _enemyPool                  = enemyPool;
     _asyncProcessor             = asyncProcessor;
     _settings                   = settings;
     _camera                     = camera;
     _size                       = size;
     screenSize.ChangeSizeEvent += ScreenSizeChange;
     ScreenSizeChange(screenSize.Size);
     asyncProcessor.StartCoroutine(SpawnPoint());
     asyncProcessor.StartCoroutine(SpawnDamage());
 }
Ejemplo n.º 4
0
 public void OnPlayerTouched(PlayerTouchedSignal signal)
 {
     if (signal.objectTouchType == ObjectTouchType.LevelEnd)
     {
         _asyncProcessor.StartCoroutine(OnLevelEnd());
     }
 }
Ejemplo n.º 5
0
        private IEnumerator SpawnPoint()
        {
            while (true)
            {
                var time = Random.Range(_settings.MinPointSpawnFrequency, _settings.MaxPointSpawnFrequency);
                yield return(new WaitForSeconds(time));

                var pos       = RandPos();
                var pointView = _enemyPool.Pop(Enemy.Point, pos, Quaternion.identity);
                _activeEnemies.Add(pointView);
                pointView.DieEvent += DieEventHandler;
                _asyncProcessor.StartCoroutine(Die(pointView));
                SetSize(pointView);
                SpawnEvent?.Invoke(pointView);
            }
        }
Ejemplo n.º 6
0
 public PersonalLifeHandler(IPlayerInfoHolder playerInfoHolder, IGameInfoHolder gameInfoHolder,
                            AsyncProcessor asyncProcessor)
 {
     _playerInfoHolder    = playerInfoHolder;
     _gameInfoHolder      = gameInfoHolder;
     _asyncProcessor      = asyncProcessor;
     _increasePrivateLife = _asyncProcessor.StartCoroutine(IncreasePrivateLife());
 }
Ejemplo n.º 7
0
        public void TakeTask(int teacherNum)
        {
            _takenTasksTimes.Enqueue(_gameInfoHolder.TaskTimes[UnityEngine.Random.Range(0, _gameInfoHolder.TaskTimes.Length)]);
            _playerInfoHolder.TasksTaken = _playerInfoHolder.TasksTaken + 1;
            if (_timer == null)

            {
                _timer = _asyncProcessor.StartCoroutine(Timer());
            }
        }
Ejemplo n.º 8
0
        public void StartWaitForNextMessage(int teacherNum)
        {
            if (_nextMessageWaitors[teacherNum] != null)
            {
                _asyncProcessor.StopCoroutine(_nextMessageWaitors[teacherNum]);
                _nextMessageWaitors[teacherNum] = null;
            }

            int time = 5;

            _nextMessageWaitors[teacherNum] = _asyncProcessor.StartCoroutine(WaitForNextMessage(time, teacherNum));
        }
Ejemplo n.º 9
0
        public TasksHandler(AsyncProcessor asyncProcessor, IPlayerInfoHolder playerInfoHolder, IExperienceHandler experienceHandler, IGameInfoHolder gameInfoHolder)
        {
            _asyncProcessor    = asyncProcessor;
            _experienceHandler = experienceHandler;
            _gameInfoHolder    = gameInfoHolder;
            _playerInfoHolder  = playerInfoHolder;
            _takenTasksTimes   = new Queue <int>();
            for (int i = 0; i < _playerInfoHolder.TasksTaken; i++)
            {
                _takenTasksTimes.Enqueue(_gameInfoHolder.TaskTimes[UnityEngine.Random.Range(0, _gameInfoHolder.TaskTimes.Length)]);
            }
            if (_timer == null && _playerInfoHolder.TasksTaken > 0)

            {
                _timer = _asyncProcessor.StartCoroutine(Timer());
            }
        }
Ejemplo n.º 10
0
        IEnumerator SpawnWithRemoving()
        {
            //Создаем платформу
            var platform = CreateSpawnPlatform();

            _blocks.Add(platform);
            Paint(platform);

            //Запоминаем последний тайл блока, где нужно создавать следующий блок
            Tile lastTile = platform.GetLast();

            for (int i = 0; i < 1; i++)
            {
                var block = SpawnRandomPath(lastTile);
                _blocks.Add(block);
                Paint(block);
                //Удаляем через 3 секунды
                _asyncProcessor.StartCoroutine(RemoveBlockAfterSeconds(block, 3));

                lastTile = block.GetLast();

                yield return(new WaitForSeconds(0.5f));
            }
        }
Ejemplo n.º 11
0
 public void OnLevelEnd(LevelEndSignal signal)
 {
     _asyncProcessor.StartCoroutine(LevelEnd());
 }
Ejemplo n.º 12
0
 public void OnLevelEnd(LevelEndSignal signal)
 {
     _asyncProcessor.StartCoroutine(PlayPlayerAnimation());
     _asyncProcessor.StartCoroutine(PlayUIAnimation());
 }
Ejemplo n.º 13
0
 public void StartCorutinePutItBackInPooledObjects(TrailRenderer PooledObject)
 {
     m_AsyncProcessor.StartCoroutine(PutItBackInPooledObjects(PooledObject));
 }