输入框回车

GUI.SetNextControlName("InputFieldLC");   
inputLC = GUI.TextField(new Rect(Screen.width / 2 + 240,Screen.height - 30,100,20),inputLC);   
if(GUI.Button(new Rect(Screen.width / 2 + 340, Screen.height - 30,40,20),"定位"))  
{   
    if(wwwIng == false)   
    {     
        wwwIng = true;    
        Application.ExternalCall("DingWeiLC", qjModel.lloryl, inputLC, qjModel.lx);    
    }   
}      
if (Event.current.isKey && Event.current.keyCode == KeyCode.Return && GUI.GetNameOfFocusedControl() == "InputFieldLC")  
{    
    if(wwwIng == false)   
    {    
        wwwIng = true;     
        Application.ExternalCall("DingWeiLC", qjModel.lloryl, inputLC, qjModel.lx);    
    }   
}

posted @ 2012-04-17 16:26  渡蓝  阅读(182)  评论(0编辑  收藏  举报