private static void CreateBootstrapper() { if (bootstrapped) { return; } bootstrapped = true; /*if (otherNewtonsoftJson != null) * Assembly.LoadFrom(otherNewtonsoftJson);*/ Application.logMessageReceived += delegate(string condition, string stackTrace, LogType type) { var level = UnityLogRedirector.LogTypeToLevel(type); UnityLogProvider.UnityLogger.Log(level, $"{condition}"); UnityLogProvider.UnityLogger.Log(level, $"{stackTrace}"); }; // need to reinit streams singe Unity seems to redirect stdout StdoutInterceptor.RedirectConsole(); var bootstrapper = new GameObject("NonDestructiveBootstrapper").AddComponent <Bootstrapper>(); bootstrapper.Destroyed += Bootstrapper_Destroyed; }
private static void CreateBootstrapper() { if (bootstrapped) { return; } bootstrapped = true; Application.logMessageReceived += delegate(string condition, string stackTrace, LogType type) { var level = UnityLogRedirector.LogTypeToLevel(type); UnityLogProvider.UnityLogger.Log(level, $"{condition}"); UnityLogProvider.UnityLogger.Log(level, $"{stackTrace}"); }; StdoutInterceptor.EnsureHarmonyLogging(); // need to reinit streams singe Unity seems to redirect stdout StdoutInterceptor.RedirectConsole(); InstallHarmonyProtections(); var bootstrapper = new GameObject("NonDestructiveBootstrapper").AddComponent <Bootstrapper>(); bootstrapper.Destroyed += Bootstrapper_Destroyed; }