Many thanks, the frame debugger was very useful in identifying the issue.
I have uploaded the information displayed by the frame debgger, and I have set out an explanation of the steps I have taken and what appears to be the position.
If the lights and the sprites are deactivated and reactivated Unity appears to render the lights again on top of the original render (this may not be technically what is happening). This can be seen from the information provided by the frame Debugger.
For example, if I expand any of the Render 2D Lighting and click through the various components, there comes a point when they keep repeating. There is also a clear increase in numbers, e.g., the first Render 2D lighting is 82 and after a few times deactivating and reactivating the ‘screen box’ that contains the lights and the sprites, the figure increases to 370. The same is true for all the other Render 2D Lighting. This occurs when:
-
the gameobject with the Light2D component is deactivated and then activated as well as the Sprites; or
-
both the gameobject with the Light2D component and the Light2D component itself are disabled and enabled as well as the sprites.
However, if only the gameobject with the Light2D component is deactivated and reactivated i.e., the sprites are not also deactivated, this does not happen. Unfortunately, this is not an option since not deactivating the sprites impact on performance.
On other hand, if the gameobjects containing the sprite renderer are disabled but the Light2D components are not disabled, the same issue arises.
It appeared that if the Sprite Renderer component only of all the gameobjects was disabled, but not the gameobject itself, and the Lights were all disabled, the issue did not seem to arise when they were then enabled; however, it turned out that this did not make a difference and the issue still occurs.
Therefore, whilst the frame debugger shows that the gameobjects are all being deactivated and activated, the lights are being rendered again each time that the gameobjects that contain the sprite renderer component as well as the 2D lights are deactivated and activated. This is the cause of the fps drop, but I do not know how to resolve this issue since it would appear to me that it may be caused by the way the light2D component and/or the 2d renderer render the lights. Using version 2019.4.17f1, and I have tried URP 7.5.2 and 7.3.1.