Home > OS >  All compiler errors have to be fixed before you can enter playmode
All compiler errors have to be fixed before you can enter playmode

Time:07-01

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

CodePudding user response:

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.

CodePudding user response:

input.getKey (KeyCode.Escape)

Here the caption is wrong it should be

Input.GetKey(KeyCode.Escape)
  • Related