Пример #1
0
    private void listLevels()
    {
        this.lastIdx = -1;

        for (int i = SceneMng.sceneCountInBuildSettings; i > 0; i--)
        {
            string name = SceneUtil.GetScenePathByBuildIndex(i - 1);
            if (name.EndsWith(".unity"))
            {
                name = name.Remove(name.Length - 6);
            }
            if (name.EndsWith(this.StopLoadingAt))
            {
                this.lastIdx = i - 1;
                break;
            }
        }
        if (this.lastIdx == -1)
        {
            throw new System.Exception("Couldn't find the last level");
        }

        if (LevelSelectMenu.cache == null)
        {
            cache = new CachedLevel[this.lastIdx - 1];
            for (int i = 0; i < LevelSelectMenu.cache.Length; i++)
            {
                LevelSelectMenu.cache[i].tex  = null;
                LevelSelectMenu.cache[i].mat  = null;
                LevelSelectMenu.cache[i].name = LevelNameList.GetLevel(i + 1);
            }
        }

        this.numItems = LevelSelectMenu.cache.Length;
    }
Пример #2
0
    public void OnSSTaken(TexBuffer tex, Material mat)
    {
        string levelName = LevelNameList.GetLevel(this.curIdx);
        string fullName  = $"Level {this.curIdx} - {levelName}";

        CreateLevelSelectors.cache[this.curIdx].tex  = tex;
        CreateLevelSelectors.cache[this.curIdx].mat  = mat;
        CreateLevelSelectors.cache[this.curIdx].name = fullName;

        this.createLevelSelector(this.curIdx);

        this.curIdx++;
        if (this.curIdx < this.lastIdx)
        {
            this.StartCoroutine(this.startLoadLevel());
        }
    }
Пример #3
0
    private string getLevelName(string sep)
    {
        string levelName = LevelNameList.GetLevel(currentLevel);

        return($"Level {currentLevel}{sep}{levelName}");
    }