The Update function and UI values
There is one thing I want to mention here. As you must have noticed, we are updating all UI values in the Update
function. As the Update
function is called on every frame, we are wasting a lot of computation power there. This isn't the most efficient or correct way of assigning these values for every frame. Ideally, we change the text value only when we need to; for example, when the value actually changes. I decided to show you this way because it's definitely the simplest way. As this book is written for you, a beginner in programming, this way just works.