public static void SetNextLevel(this LevelModelWall model, ILevelDatasContainer container) { int newLevelIndex = model.LevelIndex + 1; if (newLevelIndex >= container.LevelDatas.Length) { newLevelIndex = 0; } model.SetLevelData(container, newLevelIndex); }
public static void SetLevelData(this LevelModelWall model, ILevelDatasContainer dataContainer, int levelIndex) { model.LevelIndex = levelIndex; model.LevelData = dataContainer.LevelDatas[levelIndex]; }