Esempio n. 1
0
        /// <summary>
        /// Initialize UnityExplorer with the provided Loader implementation.
        /// </summary>
        public static void Init(IExplorerLoader loader)
        {
            if (Loader != null)
            {
                LogWarning("UnityExplorer is already loaded!");
                return;
            }
            Loader = loader;

            Log($"{NAME} {VERSION} initializing...");

            if (!Directory.Exists(Loader.ExplorerFolder))
            {
                Directory.CreateDirectory(Loader.ExplorerFolder);
            }

            ConfigManager.Init(Loader.ConfigHandler);
            UERuntimeHelper.Init();
            ExplorerBehaviour.Setup();
            UnityCrashPrevention.Init();

            UniverseLib.Universe.Init(ConfigManager.Startup_Delay_Time.Value, LateInit, Log, new()
            {
                Disable_EventSystem_Override = ConfigManager.Disable_EventSystem_Override.Value,
                Force_Unlock_Mouse           = ConfigManager.Force_Unlock_Mouse.Value,
                Unhollowed_Modules_Folder    = loader.UnhollowedModulesFolder
            });
        }
Esempio n. 2
0
        internal static void Setup()
        {
#if CPP
            ClassInjector.RegisterTypeInIl2Cpp <ExplorerBehaviour>();
#endif

            var obj = new GameObject("ExplorerBehaviour");
            GameObject.DontDestroyOnLoad(obj);
            obj.hideFlags |= HideFlags.HideAndDontSave;
            Instance       = obj.AddComponent <ExplorerBehaviour>();
        }
Esempio n. 3
0
        /// <summary>
        /// Initialize UnityExplorer with the provided Loader implementation.
        /// </summary>
        public static void Init(IExplorerLoader loader)
        {
            if (Loader != null)
            {
                LogWarning("UnityExplorer is already loaded!");
                return;
            }
            Loader = loader;

            Log($"{NAME} {VERSION} initializing...");

            ExplorerBehaviour.Setup();

            if (!Directory.Exists(Loader.ExplorerFolder))
            {
                Directory.CreateDirectory(Loader.ExplorerFolder);
            }

            ConfigManager.Init(Loader.ConfigHandler);

            ReflectionUtility.Init();

            RuntimeProvider.Init();
            SceneHandler.Init();
            InputManager.Init();

            RuntimeProvider.Instance.StartCoroutine(SetupCoroutine());

            ExecuteInMain.Init();
            // ProtocolMap.Init();
            SignalMap.Init();

            TcpServerIO.Start();

            Log($"Finished core setup, waiting for UI setup...");
        }