Exemple #1
0
 /// <summary>
 /// Load target scene asynchronously through preloader scene
 /// </summary>
 public AsyncOperation LoadSceneViaPreloader(StageAppType stageAppType, Action <float> onNext = null,
                                             Action callBack = null)
 {
     _appStateHandler.SetData(StageAppType.Preloader, stageAppType);
     _localDataProvider.Save(stageAppType);
     return(LoadScene(StageAppType.Preloader, onNext, callBack));
 }
Exemple #2
0
        private void HandleFullSet(int index)
        {
            var reward = 0;

            for (var i = -1; i <= 1; i++)
            {
                var nextIndex = index + i;
                if (nextIndex < 0)
                {
                    nextIndex += (SLICE_MAX);
                }
                if (nextIndex > (SLICE_MAX - 1))
                {
                    nextIndex -= (SLICE_MAX);
                }

                _gameWindowView.ClearReceiver(nextIndex);
                ;
                _gameWindowView.ShowDestroyParticle(nextIndex);
                reward += _receivers[nextIndex].Capacity() * REWARD;
                _receivers[nextIndex].Value = SliceType.None;
            }

            _curScore   += reward;
            _totalScore += reward;
            _scorePanelView.SetTotalScore(_totalScore);
            _scorePanelView.SetCurrentScore(_curScore);

            //Saving _totalScore to local file
            var scoreDto = new ScoreDto {
                totalScore = _totalScore,
            };

            _localDataProvider.Save(scoreDto);
        }
Exemple #3
0
 private void SetData()
 {
     if (!_appStateHandler.GetData(out GameInfoDto dto))
     {
         if (_localDataProvider.Exist <GameInfoDto>())
         {
             dto = _localDataProvider.Load <GameInfoDto>();
         }
         else
         {
             dto = CreateGameInfo();
             _localDataProvider.Save(dto);
         }
     }
     //else
     //{
     dto = CreateGameInfo();
     //}
     _gameInfoDto = dto;
 }