Search Unity

All compiler errors have to be fixed before you can enter playmode! UnityEditor.SceneView:ShowCompil

Discussion in 'Scripting' started by ytkonkom, Jun 30, 2022.

  1. ytkonkom

    ytkonkom

    Joined:
    Jun 30, 2022
    Posts:
    1
    Hello where is the error?

    Error:
    • All compiler errors have to be fixed before you can enter playmode!
    • UnityEditor.SceneView:ShowCompileErrorNotification ()
    code:


    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5. public class MenuGlowne : MonoBehaviour {
    6.  
    7.     public string obecneOkno = "";
    8.     Vector2 srodekEkranu;
    9.     string login = "";
    10.     string haslo = "";
    11.     string email = "";
    12.     void Start () {
    13.         srodekEkranu = new Vector2(Screen.width/2-100, Screen.height/2-15);
    14.     }
    15.  
    16.     void Update()
    17.     {
    18.         if(input.getKey (KeyCode.Escape)){
    19.             obecneOkno = "login";
    20.         }
    21.     }
    22.     void OnGUI(){
    23.         switch (obecneOkno){
    24.             case "login":
    25.                 PokazOknoLogowania();
    26.                 break;
    27.             case "rejestracja":
    28.                 PokazOknoRejestracji();
    29.                 break;
    30.  
    31.             case "menuGlowne":
    32.  
    33.                 break;
    34.  
    35.             case "lobby":
    36.  
    37.                 break;
    38.         }
    39.     }
    40.     void PokazOknoLogowania(){
    41.         login = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y, 200, 30), login, 20, "box");
    42.         haslo = GUI.PasswordField (new Rect(srodekEkranu.x, srodekEkranu.y+35, 200, 30),haslo, '*', 20, "box");
    43.         if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+75, 200, 30),"Zaloguj")){
    44.             GenerujLinkLoginu();
    45.         }
    46.         if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+140, 200, 30),"Rejestracja")){
    47.             obecneOkno = "rejestracja";
    48.         }
    49.     }
    50.     void PokazOknoRejestracji(){
    51.         login = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y-70, 200, 30), login, 20, "box");
    52.         GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y-70, 100, 30),"Podaj login:");
    53.         email = GUI.TextField (new Rect(srodekEkranu.x, srodekEkranu.y-35, 200, 30), email, 100, "box");
    54.         GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y-35, 100, 30),"Podaj E-mail:");
    55.         haslo = GUI.PasswordField (new Rect(srodekEkranu.x, srodekEkranu.y+35, 200, 30),haslo, '*', 20, "box");
    56.         GUI.Label (new Rect(srodekEkranu.x-205, srodekEkranu.y+35, 100, 30),"Podaj Hasło:");
    57.         if (GUI.Button (new Rect(srodekEkranu.x, srodekEkranu.y+75, 200, 30),"Zarejestruj")){
    58.             GenerujLinkRejestracji();
    59.         }
    60.     }
    61.     void GenerujLinkLoginu(){
    62.         WWWForm w = new WWWForm();
    63.         w.AddField ("login",login);
    64.         w.AddField ("haslo",haslo);
    65.         WWW link = new WWW("http://localhost/unity/login.php", w);
    66.         StartCoroutine (Zaloguj (link));
    67.     }
    68.     IEnumerator Zaloguj(WWW link) {
    69.         yield return link;
    70.  
    71.         Debug.Log (link.text);
    72.     }
    73.  
    74.     void GenerujLinkRejestracji(){
    75.         WWWForm w = new WWWForm();
    76.         w.AddField ("login",login);
    77.         w.AddField ("haslo",haslo);
    78.         w.AddField ("email",email);
    79.         WWW link = new WWW("http://localhost/unity/register.php", w);
    80.         StartCoroutine (Zarejestruj (link));
    81.     }
    82.  
    83.     IEnumerator Zarejestruj(WWW link){
    84.         yield return link;
    85.  
    86.         Debug.Log (link.text);
    87.     }
    88. }
     
  2. venom789

    venom789

    Joined:
    Apr 18, 2022
    Posts:
    178
    In your console, you should have one or more errors in red.

    With parenthesis numbers, the first number represents the line of error: (number,number).

    No sane person will have the courage to read such a long code, if you had the line of the error it would be easier to identify the problem.