public void GetLeaderBoard() { if (_getPosition != null) { _asyncProcessor.StopCoroutine(_getPosition); _getPosition = null; } _getPosition = _asyncProcessor.StartCoroutine(GetLeaderBoardCoroutine()); }
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)); }
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; }
public void Dispose() { _asyncProcessor.StopCoroutine(_increasePrivateLife); _increasePrivateLife = null; }