I would like my Score Manager to update

Hi Zunaim,

Before assigning a string to scoreText.text, you could check the value of score with an if-statement or a switch. If the value is 1000, you divide the score value by 1000.

Use a local float variable in your method to store the result.
Your units (Gigabytes, Megabytes) could be defined in a string array at the top of your class. And in your method, you could define another local variable of type int which holds the index for the string array.

Then you set the values of the two variables based on your rules.

And the last step would be to concatenate both and assign them to scoreText.text.

Did this help?


See also:

1 Like