protected override List <string> GetAllIssues() { var issues = new List <string>(); var levels = new HashSet <string>(); #if UNITY_EDITOR var gameLevels = UnityResourceUtils.FindAssetsByType <GameLevels>(); gameLevels.SelectMany(zone => zone.Value).ForEach(level => { var n = $"{level.name}"; levels.Add(level.GetInstanceID().ToString()); map.InitLevel(level.name); current.SelectLevel(level, -1, -1); current.Init(); if (map.Min.x < 0 || map.Min.y < 0) { issues.Add($"{n} has pieces below (0, 0)"); } else if (map.Min.x > 0 || map.Min.y > 0) { issues.Add($"{n} doesn't start at (0, 0)"); } }); map.InitLevel("Uninitialized"); current.Clear(); Debug.Log($"Tested {levels.Count} Levels in {gameLevels.Count} Zones for Positioning"); issues.ForEach(Debug.LogError); #endif return(issues); }
public IEnumerator AnalyzeAll() { #if UNITY_EDITOR var complexities = new List <string>(); var gameLevels = UnityResourceUtils.FindAssetsByType <GameLevels>(); foreach (var zone in gameLevels) { foreach (var level in zone.Value) { if (level.IsTutorial) { continue; } map.InitLevel(level.name); current.SelectLevel(level, -1, -1); current.Init(); var levelMap = map.GetLevelMap(); var stats = levelMap.BasicComplexityStats(); complexities.Add(stats.ToString()); Debug.Log($"Stats: {stats}"); yield return(new WaitForEndOfFrame()); } } Debug.Log($"Analyzed {complexities.Count} Levels in {gameLevels.Count} Zones for Complexity"); #endif yield break; }
public void InitLevel() { currentZone.Init(currentLevel.ZoneNumber); currentLevelStars.Reset(); currentMoveCounter.Reset(); currentLevelMap.InitLevel(CurrentLevel.ActiveLevel.name); currentPiece.Deselect(); currentLevel.Init(); hasResetLevel.Value = false; Message.Publish(new LevelReset()); }
private void Awake() { currentLevelMap.InitLevel("Uninitialized"); }