I have attached several scripts to an empty Game Manager object. The scripts named GameManager, LevelManager, ScoreManager and TimerManager each has many functions to handle game state and scores. I am wondering what is the best practice to update UI texts and show/hide panels/sprites from these scripts. For readability and maintainability of code it is cleaner to keep updates in separate scripts. For example Score Manager could update score text field and Level Manager could show/hide level panel. My question is for optimal performance is it better to place all UI update from one script’s update function ?
Best practice in general is to avoid changes when not needed.
for example if you gain score by colliding with some object, you should update the score only when you collide with that object and not in every frame(like Update() do.)