Animated Demo
Interactive Demo
Contains a simple shader that can be used to easily create/animate bars for displaying various stats to players. Can be colored and styled with a single overlay image. Works well both for flat 3d meshes with 'unit' UV coordinates, and for turning UGUI images into an easy-to-manage display.
Segments of the bar can be colored differently, such as the 'filled' or 'empty' segments, and a part of the bar can be colored differently while 'emptying' or 'filling'.
To style something as a bar, just create a new material, select the "Bars/Simple" shader, and apply the material!
To set/animate the bar, change the "_Fill" and "_Delta" properties on the material from a script. An example is provided to show how the bars can be animated. Much easier than fussing with RectTransforms!