예제 #1
0
        static void HandleLogMessageReceived(string condition, string stackTrace, LogType type)
        {
            string formattedMessage = QBMessagePacker.PackMessage(condition, stackTrace, type);

            // Write to stdout so it can be get by the editor
            Console.WriteLine(formattedMessage);
        }
예제 #2
0
        void HandleOutputDataReceived(object sender, DataReceivedEventArgs e)
        {
            // Should be dispatched on Unity thread !
            string  condition;
            string  stackTrace;
            LogType logType;

            if (QBMessagePacker.UnpackMessage(e.Data, out condition, out stackTrace, out logType))
            {
                string messageContent = string.Format("{0}{1}<i>{2}</i>", condition, System.Environment.NewLine, stackTrace);
                string message        = string.Format(QBMessageFormatPrefix, _instanceID, messageContent);
                switch (logType)
                {
                case LogType.Log:
                    UnityEngine.Debug.Log(message);
                    break;

                case LogType.Warning:
                    UnityEngine.Debug.LogWarning(message);
                    break;

                default:
                    UnityEngine.Debug.LogError(message);
                    break;
                }
            }
            else
            {
                UnityEngine.Debug.Log(string.Format(QBMessageFormatPrefix, _instanceID, e.Data));
            }
        }