#you d have to show code no idea what you

1 messages · Page 1 of 1 (latest)

autumn tapir
#
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

fleet adder
autumn tapir
#

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

fleet adder
#

Are you trying to make a clicker game?

autumn tapir
#

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

fleet adder
#

shouldn't be using any of that

autumn tapir
#

what should i use

fleet adder
autumn tapir
#

i dont get any of that

fleet adder
#

you don't really have to "get" it

#

just use something like that

#

it's a datatype appropriate for idle/clicker games