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 + "$";
}
}
Да я уже почитал и все исправил но все таки 1 ошибка осталась
вот код
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 int bonus = 1;
public int[] shopCosts
private void Update()
{
scoreText.text = score + "$";
}
public void shopPan_ShowAndHide()
{
shopPan.SetActive(!shopPan.activeSelf);
}
public void shopBttn_addBonus(int bonusPlus)
{
if (score >= 20)
{
bonus += bonusPlus;
score -= 20;
}
}
public void OnClickButton()
{
Score += bonus;
}
}