访问GUItexture

// Tests if the mouse is touching a GUIElement.
// Add a GUITexture and put the mouse over it and
// it will print the GUITexture name.
private var test : GUILayer;
test = Camera.main.GetComponent(GUILayer);
function Update() {
    if(test.HitTest(Input.mousePosition) != null) {
        Debug.Log(test.HitTest(Input.mousePosition).name);
    }
}

你可能感兴趣的:(itext)