예제 #1
0
        private List <MadLevelScene> ScenesInOrder(MadLevelScene currentLevel)
        {
            List <MadLevelScene> scenes = new List <MadLevelScene>();

            scenes.AddRange(scenesBefore);
            scenes.Add(currentLevel);
            scenes.AddRange(scenesAfter);

            return(scenes);
        }
예제 #2
0
        public bool CanContinue(MadLevelScene currentLevel, int progress)
        {
            var scenes = ScenesInOrder(currentLevel);

            if (scenes.Count > progress + 1)
            {
                return(true);
            }

            return(false);
        }
예제 #3
0
    public AsyncOperation ContinueAsync(MadLevelScene currentLevel, int progress) {
        if (!CheckCanContinue(currentLevel, progress)) {
            return null;
        }

        var scenes = ScenesInOrder(currentLevel);
        var scene = scenes[progress + 1];

        MadLevel.currentExtensionProgress = progress + 1;
        return scene.LoadAsync();
    }
예제 #4
0
    public void Continue(MadLevelScene currentLevel, int progress) {
        if (!CheckCanContinue(currentLevel, progress)) {
            return;
        }

        var scenes = ScenesInOrder(currentLevel);
        var scene = scenes[progress + 1];

        MadLevel.currentExtensionProgress = progress + 1;
        scene.Load();
    }
예제 #5
0
        private bool CheckCanContinue(MadLevelScene currentLevel, int progress)
        {
            if (!CanContinue(currentLevel, progress))
            {
                Debug.LogError(
                    "Cannot continue the level, this is the last scene. Please use MadLevel.CanContinue() to check "
                    + "if level can be continued. Now you have to use MadLevel.LoadNext(), MadLevel.LoadLevelByName() or similar.");
                return(false);
            }

            return(true);
        }
예제 #6
0
        public AsyncOperation ContinueAsync(MadLevelScene currentLevel, int progress)
        {
            if (!CheckCanContinue(currentLevel, progress))
            {
                return(null);
            }

            var scenes = ScenesInOrder(currentLevel);
            var scene  = scenes[progress + 1];

            MadLevel.currentExtensionProgress = progress + 1;
            return(scene.LoadAsync());
        }
예제 #7
0
        public void Continue(MadLevelScene currentLevel, int progress)
        {
            if (!CheckCanContinue(currentLevel, progress))
            {
                return;
            }

            var scenes = ScenesInOrder(currentLevel);
            var scene  = scenes[progress + 1];

            MadLevel.currentExtensionProgress = progress + 1;
            scene.Load();
        }
예제 #8
0
    private bool CheckCanContinue(MadLevelScene currentLevel, int progress) {
        if (!CanContinue(currentLevel, progress)) {
            Debug.LogError(
                "Cannot continue the level, this is the last scene. Please use MadLevel.CanContinue() to check "
                + "if level can be continued. Now you have to use MadLevel.LoadNext(), MadLevel.LoadLevelByName() or similar.");
            return false;
        }

        return true;
    }
예제 #9
0
    private List<MadLevelScene> ScenesInOrder(MadLevelScene currentLevel) {
        List<MadLevelScene> scenes = new List<MadLevelScene>();
        scenes.AddRange(scenesBefore);
        scenes.Add(currentLevel);
        scenes.AddRange(scenesAfter);

        return scenes;
    }
예제 #10
0
    public bool CanContinue(MadLevelScene currentLevel, int progress) {
        var scenes = ScenesInOrder(currentLevel);
        if (scenes.Count > progress + 1) {
            return true;
        }

        return false;
    }