public void addToInvo(GameObject obj) { if (inventory.checkIfWeCanAdd(obj.GetComponent <ItemPickup>().item)) { objPoolManager.ObjectPoolAddition(obj); ItemPickup ip = obj.GetComponent <ItemPickup>(); tempItem = ip.item; tempItemCount = ip.count; inventory.Add(tempItem, tempItemCount); } else { objPoolManager.DropTable(obj, transform.position); } /* tempItemGameobject = obj; * * Debug.Log(tempItemGameobject.name); * if (tempItemCount <= 0) * { * Debug.LogError(tempItemGameobject.name + " item pickup count is 0 or less then"); * } * * * objPoolManager.ReturnFromPool(obj);*/ }