Пример #1
0
    public AsyncOperation LoadAsync(MadLevelConfiguration.Level level) {
        MadLevel.currentExtension = this;
        MadLevel.currentExtensionProgress = 0;

        if (scenesBefore.Count != 0) {
            var scene = scenesBefore[0];
            MadLevel.lastPlayedLevelName = MadLevel.currentLevelName;
            MadLevel.currentLevelName = level.name;
            return scene.LoadAsync();
        } else {
            return level.LoadAsync();
        }
    }
Пример #2
0
    public AsyncOperation LoadAsync(MadLevelConfiguration.Level level) {
        if (Application.isLoadingLevel) {
            Debug.LogWarning("The level is already loading");
            return null;
        }

        MadLevel.currentExtension = this;
        MadLevel.currentExtensionProgress = 0;

        if (scenesBefore.Count != 0) {
            var scene = scenesBefore[0];
            MadLevel.lastPlayedLevelName = MadLevel.currentLevelName;
            MadLevel.currentLevelName = level.name;
            return scene.LoadAsync();
        } else {
            return level.LoadAsync();
        }
    }
Пример #3
0
    static AsyncOperation LoadLevelAsync(MadLevelConfiguration.Level level) {
        if (!CheckLevelLoading()) {
            return null;
        }

        currentExtension = null; // extension should be reset when loading like this

        if (level.hasExtension) {
            var extension = level.extension;
            return extension.LoadAsync(level);
        } else {
            return level.LoadAsync();
        }
    }
Пример #4
0
    static AsyncOperation LoadLevelAsync(MadLevelConfiguration.Level level) {
        currentExtension = null; // loading level that way resets the extension

        if (level.hasExtension) {
            var extension = level.extension;
            return extension.LoadAsync(level);
        } else {
            return level.LoadAsync();
        }
    }