Filling a gas tank.

I am working on a game where I would like to display a meter in the HUD of the vehicle showing fuel level. Once it gets low enough I want the vehicle to be able to pull into a gas station and using a gas can fill up the gas meter again as if you are filling the car with gas. What script would I use for that or what logic in Unity would allow me to do so?

One way would be to have a small texture with bottom half green and top half red then use SetTextureOffset to adjust which part is shown.

This might be of use