The effect of using the material
https://github.com/zheyuanzhou/Youtube-Unity-Tutorial/tree/master/EP45_Health%20Bar/Sprites
is shown in the figure below:
first create a new Canvas in the scene, and name it HeathBar, and create Three images are used as the sub-objects of the former, and they are respectively named bg (empty blood bar background), Effect (buffer effect when showing "blood loss"), and HP (display blood volume). And place the latter under the former in the order described above; as shown in the figure below, the levels of the three should be as shown in the figure below (the 3D view is used for better illustration, the actual project is still
2D):
Assign the material to the bg, Effect, and HP Image components under HeathBar and set them as follows:
For the Image component of bg, check Preserve Aspect to use the original length ratio of the image