public void LoadNextLevel() { _currentSection.OnComplete(); ++_currentLevel; var nextLevel = Get(_currentLevel); Attach(_currentSection, nextLevel); Free(_currentSection); _currentSection = nextLevel; _currentSection.Init(LevelDb.GetLevel(_currentLevel)); }
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); } }
public void Restart() { _currentSection.OnComplete(); _currentSection.Init(LevelDb.GetLevel(_currentLevel)); _picker.Init(_currentSection.StartPosition()); }