I had accidentally covered the same problem in a different way, because I made a plan to have to deliver X packages of different colors to each customer. So last lecture I had written this, and it works perfect.
if (other.tag == "BlueCustomer")
{
if (bluePackage >=1)
{
blueDelivery = bluePackage;
bluePackage = 0;
Debug.Log(bluePackage);
Debug.Log(blueDelivery);
}
}