I’m in charge of 2D physics here at Unity so first-up, welcome!
I have to say I do love this dynamic where an intangible thing such as a shadow becomes an interactive element such as a surface; makes me want to roll-up my sleeves and experiment!
So my description here might be a little complex if you’re relatively new to Unity but with that said, you sound like you’re not worried by complexity so if I can help, I will either here or DM me.
So maybe performance isn’t the first thing on your mind here but I wanted to bring to your attention some new features in Unity that I introduced in 2021.2 that will massively help you moving forward.
CustomCollider2D & PhysicsShapeGroup2D & Collider2D.GetShapes.
Essentially 2D physics only has 4 primitive shape types: Circle, Capsule, Polygon and Edge. The custom collider gives you direct access to creating these without any other hidden processes getting in the way. You can create any number of these shapes of varying kinds. You can also modify them directly, adding/removing them and changing their details. This is far faster then using things like the CompositeCollider2D or PolygonCollider2D which do an awful lot of work behind the scenes decomposing the paths (which are not physics things) into primitives, either edges or polygons.
For those “shadow platforms”, which to me look like they can simply be edges, you can add an edge to the CustomCollider2D. You can also add/remove as many edges as you like. Also edges have this feature which allows you to place them and specify the “adjacent” start/end points which are a ghost edge which is a hint to solver to ensure that you can smoothly move on/off them without catching the start/end points known as ghost collisions.
I put up a bunch of dev videos showing the CustomCollider2D being changed in realtime. You just couldn’t do this kind of thing for any other collider type:
Also, look in my signature you’ll see I maintain a Physics 2D examples repo here for all features here. There’s a few examples driving the CustomCollider2D you can find in there. Here’s a link to the scripts used in those examples that can give you some idea of usage:
https://github.com/Unity-Technologies/PhysicsExamples2D/blob/2021.2/Assets/Scripts/SceneSpecific/CustomCollider2D_Logo.cs
https://github.com/Unity-Technologies/PhysicsExamples2D/blob/2021.2/Assets/Scripts/SceneSpecific/CustomCollider2D_Compound.cs
Here I annotated your image to show the edge (purple) and the adjacent edges (in red). This would mean the character would gracefully move over the edge without any ghost collisions (catching the ends of the edge):
It might be worth experimenting here with the above because it would help you have an “overlay” as a CustomCollider2D for those walkable shadows where you can add/remove them at will or even have multiple ones of them so you can add/remove groups of them.
If you need any more information then ping me.