예제 #1
0
        public Message(object messageObject, DebugConsole.MessageType messageType)
        {
            this = new DebugConsole.Message(messageObject, messageType, DebugConsole.Message.defaultColor);
            switch (messageType)
            {
            case DebugConsole.MessageType.WARNING:
                this.color = DebugConsole.Message.warningColor;
                break;

            case DebugConsole.MessageType.ERROR:
                this.color = DebugConsole.Message.errorColor;
                break;

            case DebugConsole.MessageType.SYSTEM:
                this.color = DebugConsole.Message.systemColor;
                break;

            case DebugConsole.MessageType.INPUT:
                this.color = DebugConsole.Message.inputColor;
                break;

            case DebugConsole.MessageType.OUTPUT:
                this.color = DebugConsole.Message.outputColor;
                break;
            }
        }
예제 #2
0
 public static object Log(object message, DebugConsole.MessageType messageType, Color displayColor)
 {
     if (!DebugConsole.Instance.IsDebug)
     {
         return(null);
     }
     DebugConsole.Instance.LogMessage(new DebugConsole.Message(message, messageType, displayColor));
     return(message);
 }
예제 #3
0
 public override string ToString()
 {
     DebugConsole.MessageType messageType = this.type;
     if (messageType == DebugConsole.MessageType.WARNING)
     {
         return(string.Format("[{0}] {1}", this.type, this.text));
     }
     if (messageType != DebugConsole.MessageType.ERROR)
     {
         return(this.ToGUIString());
     }
     return(string.Format("[{0}] {1}", this.type, this.text));
 }
예제 #4
0
 public Message(object messageObject, DebugConsole.MessageType messageType, Color displayColor)
 {
     if (messageObject == null)
     {
         this.text = "<null>";
     }
     else
     {
         this.text = messageObject.ToString();
     }
     this.formatted = string.Empty;
     this.type      = messageType;
     this.color     = displayColor;
 }
 public Message(object messageObject, DebugConsole.MessageType messageType, Color displayColor)
 {
     if (messageObject == null)
     {
         this.text = "<null>";
     }
     else
     {
         this.text = messageObject.ToString();
     }
     this.formatted = string.Empty;
     this.type = messageType;
     this.color = displayColor;
 }