Впервые делаю кликер, нужно чтобы число 1 000 заменялось на 1k , 1 000 000 на 1m и т.д.
Вот код:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Clicker : MonoBehaviour
{
public int Score;
public int[] CostInt;
private int ClickScore = 1;
public GameObject ShopPan;
public GameObject BonusPan;
public Text[] CostText;
public Text ScoreText;
public Text TextBalance;
public Text TextUpgrade;
public void OnClickButton()
{
Score += ClickScore;
}
private void Update()
{
ScoreText.text = Score + "$";
}
public void ShowAndHideShopPan()
{
ShopPan.SetActive(!ShopPan.activeSelf);
}
public void ShowAndHideBonusPan()
{
BonusPan.SetActive(!BonusPan.activeSelf);
}
public void OnClickBuyLevel()
{
if (Score >= CostInt[0])
{
Score -= CostInt[0];
CostInt[0] *= 2;
ClickScore *= 2;
CostText[0].text = CostInt[0] + "$";
}
}
}