Exemple #1
0
 public void GetLeaderBoard()
 {
     if (_getPosition != null)
     {
         _asyncProcessor.StopCoroutine(_getPosition);
         _getPosition = null;
     }
     _getPosition = _asyncProcessor.StartCoroutine(GetLeaderBoardCoroutine());
 }
Exemple #2
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));
        }
Exemple #3
0
        private IEnumerator Timer()
        {
            while (_takenTasksTimes.Count > 0)
            {
                _currentTaskTimeLeftt = _takenTasksTimes.Dequeue();
                while (_currentTaskTimeLeftt > 0)
                {
                    yield return(new WaitForSeconds(1));

                    _currentTaskTimeLeftt--;
                }
                _experienceHandler.ChangeExperience();
                _playerInfoHolder.Coins      = _playerInfoHolder.Coins + _gameInfoHolder.TaskCompleteCoins;
                _playerInfoHolder.TasksTaken = _playerInfoHolder.TasksTaken - 1;
                CompleteTask?.Invoke();
            }
            _asyncProcessor.StopCoroutine(_timer);
            _timer = null;
        }
Exemple #4
0
 public void Dispose()
 {
     _asyncProcessor.StopCoroutine(_increasePrivateLife);
     _increasePrivateLife = null;
 }