-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDebugger.cs
55 lines (41 loc) · 1.2 KB
/
Debugger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using UnityEngine;
using System.Collections;
public class Debugger : MonoBehaviour {
static string debugLog;
public Vector2 scrollPosition= new Vector2 (800, 10);
public string longString = "This is a long-ish string";
// Use this for initialization
void Start () {
debugLog = "debugger output";
}
// Update is called once per frame
void Update () {
}
public static void Log(string message){
debugLog= "\n" + message + debugLog;
}
void OnGUI () {
/*
GUI.TextArea (new Rect (800, 10, 400, 200), debugLog);
TextEditor editor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl);
editor.selectPos = debugLog.Length + 1;
editor.pos = debugLog.Length + 1;
*/
GUILayout.BeginArea (new Rect (800, 10, 400, 200));
scrollPosition = GUILayout.BeginScrollView(new Vector2(800,10),false,false, GUILayout.Width(400), GUILayout.Height(200));
GUILayout.Label(debugLog);
GUILayout.EndScrollView();
GUILayout.EndArea ();
}
}
/*
class p {
static var pDocument : String;
static function log (string : String) {
pDocument+="n"+string;
}
}
function OnGUI () {
myLog = GUI.TextArea (Rect (10, 10, Screen.width-10, Screen.height-10), p.pDocument);
}
*/