Skip to content

Commit

Permalink
- mod Console add UNITY_ENGINE
Browse files Browse the repository at this point in the history
  • Loading branch information
chiuan committed Jul 5, 2016
1 parent aa10abd commit 13e4853
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 36 deletions.
Binary file modified TTConsole.VS/.vs/TTConsole/v14/.suo
Binary file not shown.
76 changes: 40 additions & 36 deletions TTConsole.VS/TinyTeam.Debuger/Console/Console.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
using UnityEngine;
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;

using System.Linq;

///Console to show debug
///use cmd like : ? show all cmd
///By Chiuanwei 2015-3-3

namespace TinyTeam.Debuger
namespace TinyTeam.Debuger
{
///Console to show debug
///use cmd like : ? show all cmd
///By Chiuanwei 2015-3-3

#if UNITY_ENGINE

using UnityEngine;
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;

using System.Linq;

public class Console : MonoBehaviour
{
private bool isInit = false;

#region -------------Singleton Setting------------------
#region -------------Singleton Setting------------------

private static Console _instance;
private static object _lock = new object();
Expand Down Expand Up @@ -72,7 +74,7 @@ public void OnDestroy()
StopAsyncWriteLog();
}

#endregion
#endregion

public static bool IsOpen
{
Expand Down Expand Up @@ -168,7 +170,7 @@ public static bool IsOpen
Dictionary<string, Func<string[], object>> _cmdTable = new Dictionary<string, Func<string[], object>>();
Dictionary<string, string> _cmdTableDiscribes = new Dictionary<string, string>();

#region Message Struct
#region Message Struct

//performance optimized
static Queue<Message> _messages = new Queue<Message>();
Expand Down Expand Up @@ -371,9 +373,9 @@ public string ToGUIString()
}
}

#endregion
#endregion

#region History CMD struct
#region History CMD struct

class History
{
Expand Down Expand Up @@ -411,9 +413,9 @@ public string Fetch(string cur, bool next)

History _history = new History();

#endregion
#endregion

#region Mono & base
#region Mono & base

// Use this for initialization
void Init()
Expand Down Expand Up @@ -623,9 +625,9 @@ static Color HexToColor(string hex)
return new Color32(r, g, b, 255);
}

#endregion
#endregion

#region DrawWindows
#region DrawWindows

///Init the event system if not exist.
private void InitEventSystem()
Expand Down Expand Up @@ -879,9 +881,9 @@ private void DrawFPS()
text_fps.text = "fps";
}

#endregion
#endregion

#region Console commands
#region Console commands

//==== Built-in example DebugCommand handlers ====
object CMDClose(string[] args)
Expand Down Expand Up @@ -1108,9 +1110,9 @@ object CMDStartAsyncLoging(string[] args)
}
}

#endregion
#endregion

#region InternalFunctionality
#region InternalFunctionality

void LogMessage(Message msg)
{
Expand Down Expand Up @@ -1210,9 +1212,9 @@ public void ExecCMDInputString(string inputCMD)
EvalInputString(inputCMD);
}

#endregion
#endregion

#region internal Static Api
#region internal Static Api

internal static object Log(object message, string customType)
{
Expand Down Expand Up @@ -1288,9 +1290,9 @@ public static void UnRegisterCommand(string commandString)
}
}

#endregion
#endregion

#region Event UI Process
#region Event UI Process

private void ProcessInput(string cmd)
{
Expand Down Expand Up @@ -1431,9 +1433,9 @@ private int FindEndMsgIndexFromBegin()
return curs.Count - 1;
}

#endregion
#endregion

#region Thread Writing Log
#region Thread Writing Log

/// <summary>
/// 日志buffer队列
Expand Down Expand Up @@ -1605,7 +1607,7 @@ void RunningAsyncWritingLog()
}
}

#endregion
#endregion
}

public class FPSCounter
Expand Down Expand Up @@ -1683,4 +1685,6 @@ public bool Update(int updateInterval)
}
}


#endif //#if UNITY_ENGINE
}

0 comments on commit 13e4853

Please sign in to comment.