示例#1
0
        public Entrypoint()
        {
            // Patches
            Patches.Patch();

            // Add a number of callbacks
            Stages.Setup                            += StagesOnSetup;
            SceneManager.sceneLoaded                += SceneManager_sceneLoaded;
            AppDomain.CurrentDomain.AssemblyLoad    += (sender, e) => { Assemblies[e.LoadedAssembly.FullName] = e.LoadedAssembly; };
            AppDomain.CurrentDomain.AssemblyResolve += (sender, e) =>
            {
                Assemblies.TryGetValue(e.Name, out var assembly);
                return(assembly);
            };

            // Config values
            loadDebugLevels        = Config.Bind("Debug", "LoadDebugLevels", false, "True if you want the included default levels to be loaded");
            useLegacyLoadingMethod = Config.Bind("Debug", "UseLegacyLoadingMethod", false, $"True if you want to support loading legacy v1 or standalone levels from the {Constants.LegacyLevelsDirectory} folder");

            // Legacy support
            if (useLegacyLoadingMethod.Value)
            {
                LegacySupport.EnsureLegacyFolderExists(Resources.GetFile("legacyManifest.json"));
            }
        }
示例#2
0
        void InitConfig()
        {
            LoadDebugLevels        = Config.Bind("Debug", "LoadDebugLevels", true, "True if you want the included default levels to be loaded");
            UseLegacyLoadingMethod = Config.Bind("Debug", "UseLegacyLoadingMethod", true, $"True if you want to support loading legacy v1 or standalone levels from the {Constants.LegacyLevelsDirectory} folder");

            if (UseLegacyLoadingMethod.Value)
            {
                LegacySupport.EnsureLegacyFolderExists();
            }
        }