Creating normal map from foam like geometry
I think you need Bump Map (Heightmap) ...

Unwrap from top view
Create this material with disconnected, but selected Texture node (and newly created image texture)
Bake Emit pass


Save as OpenEXR or some 32bit format.

Use the baked texture for Plane object material as Displacement ...

... wait a minute ... you said for Unity ... do you want to bake pyramid shape or foam structure for pyramid?
The thing is I used it as a Heightmap that is possible in Unity, but require dense geometry ussually optimised by tesselation - nice quick explanation - Displacement in Unity.
On other hand using Bump or Normal map affects only shading - light behaviour on a surface, that will never gives you believable result for such object.

Source

Again I didn't notice the date ... that is terrible system ...