Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Please help!,PARSING ERROR MAKES ME MAD (c #)

Discussion in 'Editor & General Support' started by DoruKs1, Jan 14, 2015.

  1. DoruKs1

    DoruKs1

    Joined:
    Jan 14, 2015
    Posts:
    28
    Hi. I'm Doruk. I'm a new member of Unity, Unity Answers, Unity Community ...
    I'm having a parsing error with my code. Please! Can you "decode" it:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class points : MonoBehaviour {
    6.  
    7.     public int puanlar = 3;
    8.     public int schoollove = 0;
    9.     public int gamelove = 0;
    10.     public int hSliderValue ;
    11.     public int hSbarValue ;
    12.     public int bir = 1;
    13.     public bool a = false;
    14.     public int X = 208;
    15.     public int Y = 304;
    16.     public int x = 10;
    17.     public int y = 10;
    18.     public bool okul;
    19.     public bool oyun;
    20.     public int iks = 15;
    21.     public int ye = 15;
    22.     // Use this for initialization
    23.     void Start () {
    24.  
    25.     }
    26.  
    27.     // Update is called once per frame
    28.     void OnGUI () {
    29.  
    30.         if (a = false)
    31.         {
    32.             if (oyun = GUI.Button (new Rect (X, Y, Screen.width * 0.25f, Screen.height * 0.1f), ""));
    33.                        
    34.         {
    35.         gamelove += bir;
    36.         puanlar -= bir;
    37.         }
    38.  
    39.         if (GUI.Button (new Rect (x,y,Screen.width*0.25f,Screen.height*0.1f), ""))
    40.             {
    41.                 puanlar -= bir;
    42.                 schoollove += bir;
    43.  
    44.             }
    45.         }
    46.  
    47.         if (puanlar == 0);
    48.         {
    49.             a = true;
    50.  
    51.         }
    52.     }
    53.  

    /\
    |
    |
    The parsing error.
     
    Last edited by a moderator: Jan 15, 2015
  2. Rasmus Selsmark

    Rasmus Selsmark

    Joined:
    Mar 13, 2013
    Posts:
    120
    Missing a "}" at the end to close your class?

    Rasmus
     
  3. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Welcome to the community, please make sure when posting code that you use code tags so that it is easily readable. A poll is also unnecessary for this kind of issue.
     
  4. DoruKs1

    DoruKs1

    Joined:
    Jan 14, 2015
    Posts:
    28
    Sorry, I know but I didn't find the code tags part.
     
  5. answerwinner

    answerwinner

    Joined:
    Jan 8, 2015
    Posts:
    47
    what is the error message
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Match your { } squiggles.
     
  7. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,952
    Also compare, don't assign. ( == not = )