所有编译器错误都必须修复,然后才能输入PlayMode

发布于 2025-02-12 01:33:29 字数 3171 浏览 2 评论 0原文

当我单击播放时,您好,我会看到此错误:

必须修复所有编译器错误,然后才能输入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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遗弃M 2025-02-19 01:33:29
input.getKey (KeyCode.Escape)

在这里标题是错误的,应该是

Input.GetKey(KeyCode.Escape)
input.getKey (KeyCode.Escape)

Here the caption is wrong it should be

Input.GetKey(KeyCode.Escape)
皓月长歌 2025-02-19 01:33:29

这意味着您需要在运行之前要解决另一个错误。单击左下方的“控制台”,并确保可见错误(窗口左上方的大多数按钮右图。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文