#you d have to show code no idea what you
1 messages · Page 1 of 1 (latest)
using System.Collections;
using UnityEngine;
using System.Threading;
using UnityEngine.UI;
public class game : MonoBehaviour
{
public Text cash;
public Text stand1price;
public Text stand1generate;
public Text stand1level;
public float Timer;
public void Increment()
{
PlayerPrefs.SetString("cash", GameManager.cash.ToString());
PlayerPrefs.SetString("stand1level", GameManager.stand1level.ToString());
PlayerPrefs.SetString("stand1price", GameManager.stand1price.ToString());
PlayerPrefs.SetString("stand1generate", GameManager.stand1generate.ToString());
}
public void upgrade1(int num)
{
if(num == 1 && GameManager.cash >= GameManager.stand1price)
{
GameManager.cash -= GameManager.stand1price;
GameManager.stand1price = (ulong)(GameManager.stand1price * 1.6f);
GameManager.stand1generate = (ulong)(GameManager.stand1generate * 1.4f);
GameManager.stand1level = (ulong)(GameManager.stand1level + 1f);
PlayerPrefs.SetString("cash", GameManager.cash.ToString());
PlayerPrefs.SetString("stand1price", GameManager.stand1price.ToString());
PlayerPrefs.SetString("stand1generate", GameManager.stand1generate.ToString());
PlayerPrefs.SetString("stand1level", GameManager.stand1level.ToString());
}
}
public void stand1()
{
}
void Update()
{
stand1price.text = " " + GameManager.stand1price;
cash.text = " " + GameManager.cash;
stand1level.text = "Level: " + GameManager.stand1level;
stand1generate.text = "$" + GameManager.stand1generate;
Timer += Time.deltaTime;
if(Timer >= 4f)
{
Timer -= 4f;
GameManager.cash += GameManager.stand1generate;
PlayerPrefs.SetString("cash", GameManager.cash.ToString());
}
}
}
the stand1generate just wont work
it doesnt have errors it literally just does nothing it stays at the default which is 2
2 * 1.4 is 2.8
when you convert that back to ulong you get 2
ah i see
im not sure what to do because if i make it a float it wont multiply or add to the ulongs
unless i convert everything to a float
Are you trying to make a clicker game?
i guess you could call it that
ive made a clicker game before a long time ago so im basing it off that i just dont want big messy decimals and the integer limit was weird when i used floats
shouldn't be using any of that
what should i use
Something like this https://gist.github.com/JcBernack/0b4eef59ca97ee931a2f45542b9ff06d
i dont get any of that