Exemple #1
0
    public void LoadNextLevel()
    {
        _currentSection.OnComplete();
        ++_currentLevel;
        var nextLevel = Get(_currentLevel);

        Attach(_currentSection, nextLevel);
        Free(_currentSection);
        _currentSection = nextLevel;
        _currentSection.Init(LevelDb.GetLevel(_currentLevel));
    }
Exemple #2
0
    public override void Init(GameManager serviceLocator)
    {
        _picker = serviceLocator.Picker;
        var entity = serviceLocator.SaveManager.Load();

        //SaveEntity entity = null;
        if (entity == null || !entity.IsSavedData)
        {
            _currentSection = Get(0);
            _currentSection.Init(LevelDb.GetLevel(0));
            _picker.Init(_currentSection.StartPosition());
        }
        else
        {
            _currentSection = Get(0, entity.LevelEntity.Position, Quaternion.identity);
            _currentLevel   = entity.LevelEntity.CurrentLevel;
            _currentSection.Init(entity.LevelEntity);
            _currentSection.ChangeMaterial(LevelDb.GetLevel(entity.LevelEntity.LevelIndex - 1).BoardMaterial);

            _picker.Init(entity.PlayerEntity.Position);
        }
    }
Exemple #3
0
 public void Restart()
 {
     _currentSection.OnComplete();
     _currentSection.Init(LevelDb.GetLevel(_currentLevel));
     _picker.Init(_currentSection.StartPosition());
 }