所有编译器错误都必须修复,然后才能输入PlayMode
当我单击播放时,您好,我会看到此错误:
必须修复所有编译器错误,然后才能输入PlayMode! unityeditor.sceneview:showcompileerrornotification()
你好,我是一个学习程序员,我在代码方面需要一些帮助。我不知道为什么,但是该程序没有启动,它只是显示一条消息,请帮助我,因为我关心代码。在屏幕中,您只能看到一个代码名称:菜单glowne何时是该代码。 代码:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MenuGlowne : MonoBehaviour {
public string obecneOkno = "";
Vector2 srodekEkranu;
string login = "";
string haslo = "";
string email = "";
void Start () {
srodekEkranu = new Vector2(Screen.width/2-100, Screen.height/2-15);
}
void Update()
{
if(input.getKey (KeyCode.Escape)){
obecneOkno = "login";
}
}
void OnGUI(){
switch (obecneOkno){
case "login":
PokazOknoLogowania();
break;
case "rejestracja":
PokazOknoRejestracji();
break;
case "menuGlowne":
break;
case "lobby":
break;
}
}
void PokazOknoLogowania(){
login = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y, 200, 30), login, 20, "box");
haslo = GUI.PasswordField (new Rect(srodekEkranu.x, srodekEkranu.y+35, 200, 30),haslo, '*', 20, "box");
if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+75, 200, 30),"Zaloguj")){
GenerujLinkLoginu();
}
if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+140, 200, 30),"Rejestracja")){
obecneOkno = "rejestracja";
}
}
void PokazOknoRejestracji(){
login = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y-70, 200, 30), login, 20, "box");
GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y-70, 100, 30),"Podaj login:");
email = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y-35, 200, 30), email, 100, "box");
GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y-35, 100, 30),"Podaj E-mail:");
haslo = GUI.PasswordField (new Rect(srodekEkranu.x, srodekEkranu.y+35, 200, 30),haslo, '*', 20, "box");
GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y+35, 100, 30),"Podaj Hasło:");
if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+75, 200, 30),"Zarejestruj")){
GenerujLinkRejestracji();
}
}
void GenerujLinkLoginu(){
WWWForm w = new WWWForm();
w.AddField ("login",login);
w.AddField ("haslo",haslo);
WWW link = new WWW("http://localhost/unity/login.php", w);
StartCoroutine (Zaloguj (link));
}
IEnumerator Zaloguj(WWW link) {
yield return link;
Debug.Log (link.text);
}
void GenerujLinkRejestracji(){
WWWForm w = new WWWForm();
w.AddField ("login",login);
w.AddField ("haslo",haslo);
w.AddField ("email",email);
WWW link = new WWW("http://localhost/unity/register.php", w);
StartCoroutine (Zarejestruj (link));
}
IEnumerator Zarejestruj(WWW link){
yield return link;
Debug.Log (link.text);
}
}
Hello when I click play I see this error:
All compiler errors have to be fixed before you can enter playmode!
UnityEditor.SceneView:ShowCompileErrorNotification ()
Hello, I am a learning programmer and I need some help with the code. I do not know why, but the program does not start, it just displayed a message, please help me because I care about the code. In the screen you can see only one code name: Menu Glowne when is this code.
code:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MenuGlowne : MonoBehaviour {
public string obecneOkno = "";
Vector2 srodekEkranu;
string login = "";
string haslo = "";
string email = "";
void Start () {
srodekEkranu = new Vector2(Screen.width/2-100, Screen.height/2-15);
}
void Update()
{
if(input.getKey (KeyCode.Escape)){
obecneOkno = "login";
}
}
void OnGUI(){
switch (obecneOkno){
case "login":
PokazOknoLogowania();
break;
case "rejestracja":
PokazOknoRejestracji();
break;
case "menuGlowne":
break;
case "lobby":
break;
}
}
void PokazOknoLogowania(){
login = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y, 200, 30), login, 20, "box");
haslo = GUI.PasswordField (new Rect(srodekEkranu.x, srodekEkranu.y+35, 200, 30),haslo, '*', 20, "box");
if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+75, 200, 30),"Zaloguj")){
GenerujLinkLoginu();
}
if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+140, 200, 30),"Rejestracja")){
obecneOkno = "rejestracja";
}
}
void PokazOknoRejestracji(){
login = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y-70, 200, 30), login, 20, "box");
GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y-70, 100, 30),"Podaj login:");
email = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y-35, 200, 30), email, 100, "box");
GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y-35, 100, 30),"Podaj E-mail:");
haslo = GUI.PasswordField (new Rect(srodekEkranu.x, srodekEkranu.y+35, 200, 30),haslo, '*', 20, "box");
GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y+35, 100, 30),"Podaj Hasło:");
if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+75, 200, 30),"Zarejestruj")){
GenerujLinkRejestracji();
}
}
void GenerujLinkLoginu(){
WWWForm w = new WWWForm();
w.AddField ("login",login);
w.AddField ("haslo",haslo);
WWW link = new WWW("http://localhost/unity/login.php", w);
StartCoroutine (Zaloguj (link));
}
IEnumerator Zaloguj(WWW link) {
yield return link;
Debug.Log (link.text);
}
void GenerujLinkRejestracji(){
WWWForm w = new WWWForm();
w.AddField ("login",login);
w.AddField ("haslo",haslo);
w.AddField ("email",email);
WWW link = new WWW("http://localhost/unity/register.php", w);
StartCoroutine (Zarejestruj (link));
}
IEnumerator Zarejestruj(WWW link){
yield return link;
Debug.Log (link.text);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在这里标题是错误的,应该是
Here the caption is wrong it should be
这意味着您需要在运行之前要解决另一个错误。单击左下方的“控制台”,并确保可见错误(窗口左上方的大多数按钮右图。
It means there is another error that you need to fix before it will run. Click on "console", to the bottom left, and make sure errors are visible (right most button in the top left of the window.