Example #1
0
        private void Awake()
        {
            Configuration.Prepare();
            CustomCmdConfig.Prepare();
            Debug.LoadConfig(Configuration);


            DontDestroyOnLoad(gameObject);
            foreach (var lsp in Streams)
            {
                LogStream ls;

                if (lsp.CreateCustomConsole)
                {
                    ls = lsp.ToLogStream(new PipeStream());
                    CmdUtils.CreateCustomConsoleNoReturn(ls.PBaseStream as PipeStream,
                                                         CustomCmdConfig); // Currently not working due to referencing problems with my compiled code(using System.Windows.Forms)
                    //Apparently Unity Editor dll loading capabilities were never meant to load system resources.(The error is that the windows forms code is not able to find System.Runtime.Interopservices.Marshal.ReadInt16)
                    //Probably dumb mistake by me. Otherwise i manage to poke some super old 16 bit code that is not supported on my 64bit machine.
                }
                else
                {
                    ls = lsp.ToLogStream();
                }

                Debug.AddOutputStream(ls);
            }

            if (UseConsole)
            {
                if (ConsoleParams.CreateCustomConsole)
                {
                    var ls = ConsoleParams.ToLogStream(new PipeStream());
                    Debug.AddOutputStream(ls);
                    CmdUtils.CreateCustomConsoleNoReturn(ls.PBaseStream as PipeStream, CustomCmdConfig);
                }
                else
                {
                    UnityUtils.CreateUnityConsole(ConsoleParams, ConsoleWarningMask, ConsoleErrorMask);
                }
            }

            if (Debug.SendUpdateMessageOnFirstLog)
            {
                CheckForUpdates();
            }
        }