M
M
MrDeniX2021-06-09 18:19:44
C++ / C#
MrDeniX, 2021-06-09 18:19:44

I did a 2d clicker on Unity, an error CS1525 appeared. How to fix?

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

public class MainMenu : MonoBehaviour 
{
  [SerializeField] int money;
  public int total_money;
  public Text moneyText;

  void Start()
  {
    money = PlayerPrefs.GetInt("money");
    total_money = PlayerPrefs.GetInt("total_money");
  }

  public void ButtonClick()
  {
    money++;
    total_money++
    PlayerPrefs.SetInt("money",money);     (ошибку выдает в этой строке)
    PlayerPrefs.SetInt("total_money",total_money);
  }

  public void ToAchievements()
  {
    SceneManager.LoadScene (1);
  }

            void Update () {
    moneyText.text = money.ToString ();
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-06-09
@MrDeniX

Missed a semicolon

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question