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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

scripts eror

Discussion in 'Scripting' started by MATVEY0, Nov 11, 2018.

  1. MATVEY0

    MATVEY0

    Joined:
    Nov 11, 2018
    Posts:
    1
    Я новичок, и для этого я сделал где-то, вероятно, ошибку в скрипте, он называется Assets / scripts / GameCntrl.cs (79,6): ошибка CS1001: Неожиданный символ `} ', ожидающий идентификатор
    private GameObject [] blocks = new GameObject [4];


    private int rand, count;
    private float rCol, gCol, bCol;
    публичный текст;
    частный статический цвет aColor;
    [HideInInspector]
    public bool next, проиграть;
    void Start () {
    count = 0;
    next = false;
    lose = false;
    rand = Random.Range (0, position.Length);
    for (int i = 0; i <position.Length; i ++) {
    блоки = Выполнять (colBlock, позиции , Quaternion.identity) как GameObject;
    if (rand == i)
    block = blocks ;
    }
    block.GetComponent <RandCol> () .right = true;
    }
    void Update () {
    если (проиграть)
    playerLose ();
    if (next &&! lose)
    nextColors ();
    }
    void nextColors () {
    подсчитывать ++;
    score.text = count.ToString ();
    aColor = new Vector4 (Random.Range (0.1f, 1f), Random.Range (0.1f, 1f), Random.Range (0.1f, 1f), 1);
    GetComponent <Renderer> () .material.color = aColor;
    next = false;
    if (count <3) {
    rCol = 0,2f;
    gCol = 0,2f;
    bCol = 0,2f;
    } else if (count> = 3 && count <5) {
    rCol = 0,1f;
    gCol = 0,1f;
    bCol = 0f;
    } else if (count> = 5) {
    rCol = 0f;
    gCol = 0f;
    bCol = 0,05f;
    }
    // Новые цвета для блоков
    rand = Random.Range (0, position.Length);
    for (int i = 0; i <position.Length; i ++) {
    если (i == rand)
    блоки .GetComponent <Renderer> () .material.color = aColor;
    else {
    float r = aColor.r + Random.Range (0.1f, rCol)> 1f? 1f: aColor.r + Random.Range (0,1f, rCol);
    float g = aColor.g + Random.Range (0.1f, gCol)> 1f? 1f: aColor.g + Random.Range (0,1f, gCol);
    float b = aColor.b + Random.Range (0.1f, bCol)> 1f? 1f: aColor.b + Random.Range (0,1f, bCol);
    блоки .GetComponent <Renderer> () .material.color = new Vector4 (r, g, b, aColor.a);
    }}

    }
    void playerLose () {
    if (PlayerPrefs.GetInt («оценка») <count)
    PlayerPrefs.SetInt («оценка», счет);
    PlayerPrefs.
    }
    }
     
  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    קודם כל תשתמש בתגיות קוד, דבר שני דבר באנגלית או שתלך לפורום ברוסית.
     
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,900
    Igen, én sem értem, amit írtok. Angolul jobb lenne a társalgás. Meg egyébként is megkáposztalaníthatatlanságoskodásaitokért.

    ps: OP, would you please put your code in code tags and try English, even if it's translated or ask someone who knows English to help you out. Thanks.
     
  4. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    holy S***, please tell me that's not an actual word. hahaha

    and yeah, even google translate will do if that's all you can do.
     
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,900
    It's an artificial word, in theory it has meaning, although it does not make any sense. Hungarian is a compound language which means we have a word and then we use prefixes and post-fixes to modify the meaning (time, ownership, sometimes adjectives, etc).

    káposzta = cabbage
    káposztalanít = remove cabbage from something or someone (artificial)
    káposztalaníthat = may remove cabbage
    káposztalaníthatatlan = it cannot be uncabbaged (yeah I know...)
    káposztalaníthatatlanság = the fact that it is uncabbageable
    ... and a lot more in one word, but again, it's a very artificial word, on the other hand, we have a similar with blasphemy :D
    megszentségteleníthetetlenségeskedéseitekért
     
    SparrowGS likes this.
  6. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    i can get behind that, we do the same in hebrew. ;)
     
    Lurking-Ninja likes this.
  7. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,900
    BTW, my favorite word is German:
    Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz (and it was a real law and a real title of such law).
     
    SparrowGS likes this.
  8. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    FML
    20 of my moneyz say that no man(or woman) on earth can remember how to spell that, let alone pronounce it.
     
  9. Reeii

    Reeii

    Joined:
    Feb 5, 2016
    Posts:
    91
    I'm here! May I get your moneyz? :rolleyes:
     
    SparrowGS and Lurking-Ninja like this.
  10. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Im gonna need to see that in real time
     
    Reeii likes this.
  11. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    you know what? keep that in mind, next Unite hit me up, we'll see whats what ;)
     
    Reeii and Lurking-Ninja like this.