// Update is called once per frame void WndDisplay(int wndId) { // Display log wndTextScroll = GUILayout.BeginScrollView(wndTextScroll); GUI.SetNextControlName("TextArea"); GUILayout.TextArea(Crown.GetLog(), GUILayout.ExpandHeight(true)); // Auto scroll if text area is not focused if (GUI.GetNameOfFocusedControl() != "TextArea") { GUI.ScrollTo(new Rect(0, 50000, 0, 0)); } GUILayout.EndScrollView(); // Display input box GUI.SetNextControlName("TextField"); wndTextField = GUILayout.TextField(wndTextField, 5000); GUI.DragWindow(); }