Exemplo n.º 1
0
        void Awake()
        {
            //if (Environment.CommandLine.Contains("--verbose"))
            //{
            Windows.GuiConsole.CreateConsole();
            //}

            Application.logMessageReceived += delegate(string condition, string stackTrace, LogType type)
            {
                var level = UnityLogInterceptor.LogTypeToLevel(type);
                UnityLogInterceptor.Unitylogger.Log(level, $"{condition.Trim()}");
                UnityLogInterceptor.Unitylogger.Log(level, $"{stackTrace.Trim()}");
            };
        }
Exemplo n.º 2
0
        static ManagerPlugin()
        {
#if DEBUG
            Logger.Filter = Logger.LogLevel.ReallyNotReccomendedAll;
#else
            Logger.Filter = Logger.LogLevel.All; // ???
#endif
            Application.logMessageReceived += delegate(string condition, string stackTrace, LogType type)
            {
                var level = UnityLogInterceptor.LogTypeToLevel(type);
                UnityLogInterceptor.Unitylogger.Log(level, $"{condition.Trim()}");
                UnityLogInterceptor.Unitylogger.Log(level, $"{stackTrace.Trim()}");
            };

            Harmony = HarmonyInstance.Create("com.cirr.beatsaber.modmanager");
            IPAPatches.IPAInject();
        }
Exemplo n.º 3
0
        private static void CreateBootstrapper()
        {
            if (_bootstrapped)
            {
                return;
            }
            _bootstrapped = true;

            Application.logMessageReceived += delegate(string condition, string stackTrace, LogType type)
            {
                var level = UnityLogInterceptor.LogTypeToLevel(type);
                UnityLogInterceptor.UnityLogger.Log(level, $"{condition.Trim()}");
                UnityLogInterceptor.UnityLogger.Log(level, $"{stackTrace.Trim()}");
            };

            // need to reinit streams singe Unity seems to redirect stdout
            WinConsole.InitializeStreams();

            var bootstrapper = new GameObject("NonDestructiveBootstrapper").AddComponent <Bootstrapper>();

            bootstrapper.Destroyed += Bootstrapper_Destroyed;
        }