Handle loose parts of a mesh individually

I was trying to make a stone wall.

Something like this:

And I want it to be one mesh.
Every stone is a loose part of the mesh.

Like this:

It’s not the mesh I’m actually using but good to show what i mean.

So the problem is, how can I texture every single stone individually (with random node or stuff) in one material in one object? Is there a way to handle loose parts of a mesh individually or do I have to make a vertex group for every single stone?

Hope someone can help me.

Well the link may help, I’ll try that.
I want to have one object with one material, I think the way explained in the link works for that.

Edit: Ok I did it in a similar way, unwrap with lightmap pack was “ok” it made every face an own island, so every brick had different colors on each face. I just unwrapped with “project from view” and scaled it down to zero (with scaling pivot: individual origins).

That works for me, thx again.