Answer the question
In order to leave comments, you need to log in
I did a 2d clicker on Unity, an error CS1525 appeared. How to fix?
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question