// Runs FIRST when Start scene is loaded (app startup) void Awake() { // DEV CryptoUtil.ResetKeys(); // END DEV if (!CryptoUtil.ValidKeys()) // Make sure we can decrypt the game data { CryptoUtil.ResetKeys(); } StaticLevelData.LoadLevelData(); GameController.Main = null; LevelSelectController.CurrentLevelPack = null; Level.CurrentLevel = Level.MenuLevel(); // Create easter egg menu level Level.CurrentLevel.Play(); //Solve.Level(Level.CurrentLevel); }
public LevelPackData(JObject lpData) { LPData = lpData; // Keep a copy so it's easy to update lpData = lpData["level_pack"].Value <JObject>(); // Remove level_pack since would be at start of every reference ID = lpData["id"].Value <int>(); Name = lpData["name"].Value <string>(); JObject progData = StaticLevelData.ReadData(ID); JArray levelsja = lpData["levels"].Value <JArray>(); Levels = new Level[levelsja.Count]; for (int i = 0; i < Levels.Length; i++) { Level level = new Level(); level.LoadFrom(levelsja[i].Value <JObject>(), progData); Levels[i] = level; } Unlocked = progData["unlocked"].Value <bool>(); Progress = progData["progress"].Value <int>(); }
// Runs when you complete the level(flip the last right tile) public void Win() { StaticLevelData.UpdateProgressData(); _winMenu.Open(); }