Comparing 2 objects for a Item System?

resolved this thank you guys

If they only have 1 instance (since I see static), then as @tanoshimi says:

if (res == item)

If not only 1 instance:

if (res.name == item.name) (replace “name” with whatever your variable is that defines items uniquely)

If you want to get fancy and not write above a hundred times (assuming you class isn’t derived from anything conflicting, like MonoBehaviour):

public class ResourceItem
{
    public string name;

    public static bool operator ==(ResourceItem a, ResourceItem b)
    {
        return a.name == b.name;
    }

    public static bool operator !=(ResourceItem a, ResourceItem b)
    {
        return !(a == b);
    }
}

then

if (res == item)

which will work for different instances as long as the name is the same.