GUI
- backgroundColor
- BeginGroup
- BeginScrollView
- Box
- BringWindowToBack
- BringWindowToFront
- Button
- changed
- color
- contentColor
- depth
- DragWindow
- DrawTexture
- enabled
- EndGroup
- EndScrollView
- FocusControl
- FocusWindow
- GetNameOfFocusedControl
- GUI
- HorizontalScrollbar
- HorizontalSlider
- Label
- matrix
- PasswordField
- RepeatButton
- ScrollTo
- SelectionGrid
- SetNextControlName
- skin
- TextArea
- TextField
- Toggle
- Toolbar
- tooltip
- UnfocusWindow
- VerticalScrollbar
- VerticalSlider
- Window
GUI.changed 判断改变
static var changed : bool
Description描述
Returns true if any controls changed the value of the input data.
返回true,如果任何控件改变了输入数据的值。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public string stringToEdit = "Modify me.";
void OnGUI() {
stringToEdit = GUI.TextField(new Rect(10, 10, 200, 20), stringToEdit, 25);
if (GUI.changed)
Debug.Log("Text field has changed.");
}
}
var stringToEdit : String = "修改我试试";
function OnGUI () {
//绘制一个文本字段,当被修改的时候打印消息
stringToEdit = GUI.TextField (Rect (10, 10, 200, 20), stringToEdit, 25);
if (GUI.changed)
//当你修改的时候,文本的时候出现这个信息。
Debug.Log("文本字段被修改");
}
最后修改:2011年6月15日 Wednesday 10:52