Никита Шишлов
Мастер
(1009)
3 недели назад
using UnityEngine;
using UnityEngine.UI;
public class GameScript : MonoBehaviour
{
public static int money;
public static int rate = 1;
public Text moneyText;
public void click()
{
money += rate;
}
public void UpgradeClick()
{
if(money >= 15)
{
money -= 15;
rate += 1;
}
}
void Update() // Исправленная функция Update
{
moneyText.text = "$" + money;
}
}
using UnityEngine;
using UnityEngine.UI;
public class GameScript : MonoBehaviour
{
public static int money;
public static int rate = 1;
public Text moneyText;
public void click()
{
money += rate;
}
public void UpgradeClick()
{
if(money >= 15)
{
money -=15;
rate +=1;
}
}
}
public void update()
{
moneyText.text = "$" + money;
}
Помогите срочно пожалуйста