i want to know when player buy a upgrade double the cost of upgrade
and how can i reflect this to cost text
here my code public Text ui;
public void Increment()
{
GameManager.wood += GameManager.multiplier;
}
public void Buy(int num)
{
if(num == 1 && GameManager.wood >= 25)
{
GameManager.multiplier += 1;
GameManager.wood -= 25;
}
if(num == 2 && GameManager.wood >= 125)
{
GameManager.multiplier += 10;
GameManager.wood -= 125;
}
if (num == 3 && GameManager.wood >= 1500)
{
GameManager.multiplier += 100;
GameManager.wood -= 1500;
}
}
public void Update()
{
ui.text = "wood:" + GameManager.wood;
}
Comment
Your answer
Follow this Question
Related Questions
Upgrading the OnLevelWasLoded code to sceneloaded in Gamemanager Script for 2D Rougelike game 0 Answers
Takes money for the next purchase and not for this one 0 Answers
Change Function On Button Press? 0 Answers
Text Label on an existing button [C#] 1 Answer
[SOLVED] Problem with OnCollisionEnter2D script after upgrading to Unity 5.3(from Unity 4.6) 1 Answer