Скрин -
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class Clicker : MonoBehaviour
{
public static Clicker Instance;
public float Money
{
get => PlayerPrefs.GetFloat("Money", 0);
set => PlayerPrefs.SetFloat("Money", value);
}
[SerializeField]
private TextMeshProUGUI money;
private void Awake()
{
Instance = this;
}
// Start is called before the first frame update
void Start()
{
UpdateUI();
}
public void Click()
{
DamageTarget(GetClickDamage());
}
private void DamageTarget(float damage)
{
Money += damage;
UpdateUI();
}
private float GetClickDamage()
{
float damage = 1;
return damage;
}
public void UpdateUI()
{
money.text = '$' + (int)Money;
}
}
Помогите пожалуйсто, заранее спасибо