小文字窗口,非常简单,使用GUI的GUILayout.TextArea即可。
这里我把鼠标位置打印出来。
GUILayout必须在OnGUI里面使用。
using UnityEngine;
using System.Collections;
public class test_input : MonoBehaviour {
string message;
void Update () {
var input = Input.mousePosition;
message = input.ToString();
}
void OnGUI(){
GUILayout.TextArea ("鼠标:"+message);
}
}
运行效果如下