I have no idea, I don't use Unity as my game engine, I use Defold. Even with the implementation in Defold it is mostly beyond me. It was a lot of complex rendering code mixed with giving specific sprites a custom material and adding a mesh to the levels for the darkness to be drawn on top of.