How to make a Field of View using meshes or masks for autogenerated Tilemap?

I am attempting to make a field of view for the player of my game. The game has the player walk around an autogenerated dungeon. I have tried using Light2D and shadows to prevent the player from seeing what’s behind walls, but it would take far too long for me to save and load prefabs for the autogenerated levels, and manually make the ShadowCaster2D shapes. I also made a mesh of a field of view cone that uses Raycasts that detect where walls are. I also thought about applying a mask to this object, but I can’t find out how to dynamically change the mask to fit the mesh shape. I only need one of these options (or a third!) to work, and any help would be greatly appreciated!