How to create an adaptive Can Counter?

I am working on an indie game and me and my team are in pre production. I am starting to put together a test build for testing the game mechanics. I have a question regarding the GUI: How to create an adaptive Can Counter?

When players collect an inventory item e.g spray can, it goes towards their can count. On the top of the screen are several things: The Spray can icon and the can counter icon.

-Spray Can Icon: When players have no spray cans, the icon is red. When they press the key bind to using a spray can, the red spray can icon shakes and an error noise is triggered. When a player has 1 or more cans and is below their capacity limit, the can icon is yellow. When players collect cans and reach their capacity limit, they can no longer collect any cans. The spray can icon is green when the limit is reached.

-Can Counter icon: is positioned next to the spray can icon e.g x12 or x1. It shows the number of cans in the player's collection. the counter does not get any higher in numbers once the can capacity limit is reached.

You need a variable called cans and you just output the integer in a GUI.label e.g.

var cans : int = 0;
var maxCans : int = 15;

funtion OnGUI(){
   GUI.Label(Rect(someRect),"Cans X " + cans, yourGUIStyle);

To limit your total cans just add an if statement:

function AddCans(number int){
      cans = maxCans;

Unity GUI documents: