My take on a custom Vertical ProgressBar for Unity's UI Toolkit, designed to track a Player Stat (Health, Mana, Etc)
To Use:
- Place
VerticalProgressBar.cswherever you wish andVerticalProgressBar.uxmlinAssets/Resources/CustomComponents/ - Drag an instance of the Template into your UI Document and set its width property.
- Set the Min (defaults to 0) and the Max (defaults to 100) to the minimum and maximum values of your tracked stat.
- Set the Value to the value of the tracked stat.
- Internal logic will handle clamping and interpolating the bar based on the given Value.