访问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);
    }
}

posted @ 2012-07-06 05:53  softimagewht  阅读(323)  评论(0编辑  收藏  举报