2015-11-08 90 views
0

由於某種原因,當我開始遊戲時,OnGui不會顯示出來。我已經附加了腳本的遊戲對象:OnGUI不會顯示

public class username : MonoBehaviour { 

private static string user = ""; 

void OnGui() 
{ 

    GUI.Label(new Rect((Screen.width/2), (Screen.height/2), 300, 300), "Username"); 
    user = GUI.TextField(new Rect(-4, 0, 100, 100), user); 

    if (GUI.Button(new Rect(-4, 0, 200, 30), "Continue")) 
    { 
     WWWForm form = new WWWForm(); 
     form.AddField("", user); 
     WWW w = new WWW("http://site/register.php", form); 
     StartCoroutine(register(w)); 
    } 

} 

感謝

回答