Вот такая ошибка:
Assets\Scripts\MainMenu.cs(32,2): error CS0106: The modifier ‘public’ is not valid for this item
Вот код:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MainMenu : MonoBehaviour
{
[SerializeField] int Score;
public Text ScoreText;
public GameObject shopPan;
private int score;
private void Update()
{
scoreText.text = score + "$";
}
public shopPan_ShowAndHide()
{
shopPan.SetActive(!shopPan.activeSelf);
}
public shopBttn_addBonus(int bonusPlus)
{
if (score >= 20)
{
bonus += bonusPlus;
score -= 20;
}
public void OnClickButton()
{
Score += bonus;
}
// Update is called once per frame
void Update()
{
ScoreText.text = Score + "$";
}
}
}