예제 #1
0
    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;
    }
    private void Calculate()
    {
        var levelMap = map.GetLevelMap();
        var stats    = levelMap.BasicComplexityStats();

        levelName       = stats.LevelName;
        difficulty      = stats.Difficulty;
        rawScore        = stats.Score;
        totalJumps      = stats.NumJumps;
        numSpaces       = stats.NumSpaces;
        pieceComplexity = stats.PieceComplexity;
    }