F
F
flanyaa2021-11-30 01:15:46
C++ / C#
flanyaa, 2021-11-30 01:15:46

How to fix error cs1519?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class mainMENU : MonoBehaviour
{
    [SerializeField] int money;
    public Text moneyText;
    public void ButtonClick();
    public bool isMulti = false;
    {
        money++;
    }

    // Update is called once per frame
    void Update()
    {

        moneyText.text = "вы погладили леона: " + money.ToString() + " раз";
    }
    public void BuyMulti()
    {
        if (money >= 100 && isMulti == false)
        {
            isMulti = true;
            money -= 100;
            PlayerPrefs.SetInt("Money",money);
            PlayerPrefs.SetInt("isMulti",isMulti ? 1 : 0);
        }
    }
    if (isMulti == true)
    {
        money += 1000;
    }
}

Gives the following error:

61a5508d8936d451934856.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-11-30
@vabka

Your brackets are crooked.
And it is specific at you if outside of a method - most likely the superfluous closing bracket.
If you press the "format document" button, you can even visually see where everything breaks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question