Can UI materials communicate between each other ?

Hey guys,

If you look at the picture bellow I made a menu (let’s call it layer A) and I’d like on the top of that a material (layer B) that can detect what’s bellow. The purpose is to modify the material assigned to layer B depending if the layer A adds, removes or moves any of its components. Does it make sense ?

Any idea are more than welcome !