Quantcast
Channel: Questions in topic: "upgrade"
Viewing all articles
Browse latest Browse all 371

Problem with upgrade and long numbers

$
0
0
1.Numbers ![alt text][1] 2.Upgrade, after upgrading once the cost changes to 0 ![alt text][2] Code: using System.Collections; using UnityEngine; public class ClickUpgrade : MonoBehaviour { public Click click; public UnityEngine.UI.Text itemInfo; public float cost; public int count = 0; public float clickPower; public string itemName; private float _newCost; void Update() { itemInfo.text = itemName + "\nCost: " + cost + "\nPower: +" + clickPower; } public void PurchasedUpgrade() { if (click.BTC >= cost) { click.BTC -= cost; count += 1; click.perclick += clickPower; cost = Mathf.Round(cost * 2); _newCost = Mathf.Pow (cost, _newCost = cost); } } } [1]: /storage/temp/110398-vanmd2dureu0-hy-iltmiq.png [2]: /storage/temp/110399-glwul4p8rwofmoa6c2nnlw.png

Viewing all articles
Browse latest Browse all 371

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>