public string findItemOfType(int itemid)
{
for (int i =0; i<=MaxCapacity(); i++ )
{
GameObject obj = GetGameObjectAt(i);
if (obj!=null)
{
if (obj.GetComponent<ObjectInteraction>()!=null)
{
if (obj.GetComponent<ObjectInteraction>().item_id==itemid)
{
return obj.name;
}
else
{
if (obj.GetComponent<ObjectInteraction>().GetItemType()==ObjectInteraction.CONTAINER)
{
string ans= obj.GetComponent<Container>().findItemOfType(itemid);
if (ans!="")
{
return ans;
}
}
}
}
}
}
return "";
}