I want to achieve that I fade from one screne into another, but not with a fade in fade out to a black screen, but a direct transition to the next scene.
My idea was to turn off the alpha channles of all my sprites.
Since I want a transition, I need to do it in a for loop with yield return null in between, the problem however is, that I can not change the alpha of all sprites simultaneously.
Enable a second camera for the transition period, then set its Target Texture parameter. Use this texture as an overlay for the main camera. When you are done you can disable the second camera, make main camera point at the new scene and unload the old one.
With this approach you can also get other transition effects, like moving in/out, tearing, blurring or scaling.
You can also add a ‘Canvas Group’ to your canvas which lets you fade out all the child objects at once (by modifying the alpha). You could load the second scene in additively but with a canvas group alpha of 0. When it’s loaded you can just lower the alpha of the first scene canvas and raise it on the second one.
This would only work for sprites and canvas objects though.
I forgot to mention that my project is for mobile (android). (Don’t think it’s important though)
@Grizmu
using a texture would mean that I need my whole scene (or what is seen in the camera view) as a “picture”.
Is that correct? (Never used textures before).
Is there a possible way to take a screenshot so that the resolution is the same as the in game resolution?
@tonemcbride
If I use a canvas, wouldn’t the result change depending on the resolution of the device?