Dev Blog for RagBall Stamina UI:
Features:
Process:
Benefits:
In Engine picture of the Default player UI asset
The character portrait is changed dynamically based on color and size
The Purple ring around the portrait shows the stamina charges which is updated upon stamina depletion or regeneration in order for the player to visibly see how much they have left
Screenshot of part of the script.
The for loop goes through the instances of players upon scene creation and instantiates the UI prefabs (you can see that the order of instantiation doesn't matter as it used the playerNumber as the index for the arrays)
The character specific details are loaded as well and then the UI's transforms are set
lastly, it subscribes the internal UpdateUI function to each of the players stamina change events