There's a quick and dirty way to do this.
Just create, outside Unity, an image, completely black except for a circle in the center.
With Gimp, follow these steps:
- Create a new image, larger than the maximum resolution you'll use in
- Fill it with black
- Add alpha channel to the layer
- Create an elliptic selection in the center
- Press delete to remove the circle
- Export the image in png format
You'll have something like this:
Now, back in Unity:
- Create a new 2D Sprite
- Set this image as its
- Set its Z position in order to put this in front of the camera, before any other sprite of your scene.
Et voilà, now you have a full, black mask with an "always on" center, and you can change the alpha channel of the sprite via script/Inspector in order to modify the opacity of the black mask.
Another way is to use an appropriate Shader, but since you're still a beginner, I would start with this simple solution. ;)
Link to a simple example for multiple spotlights with intensity controlled by script: https://github.com/Galandil74/Unity-Spotlights-Example
I prefer to use
Directional lights for the spots because of their uniformity, and the fact that their intensity is added to the ambient lighting of the scene.
Everything is handled via script, ambient light, spotlights, number of lights, etc.
All sprites affected by the lights must have a
Sprites/Diffuse shader, the
Sprites/Default shader isn't affected by lights, but only by post-effect shaders.
Sample image with 5 lights: