How can I disable my camera for a few seconds, like to show a blank screen or a texture for 3-5 seconds and than it shows the world?
There are ways to pre-load written about in the Unity documentation if you have the Pro version. I use the free version and to create a "loading" screen like this I use the following workflow:
Load Scene1 - Includes camera, GUI texture or some sort of box. Anything that will make it so whatever is rendered from the camera view is your blank screen or texture or whatever. Meanwhile, I load all of my scene2 objects with the function DontDestroyOnLoad.
After a time, I load Scene2 with all of my objects already in it from the previous scene.
Here a C# way of filling the screen with a texture:
bool showTexture = false; //Set this to true to fill the screen
Texture loadTexture; //This is what will be displayed over the whole screen.
//Somewhere else in this MonoBehaviour class, set and unset your showTexture flag.
void OnGUI()
{
if(showTexture)
{
GUI.DrawTexture(Rect(0, 0, Screen.width, Screen.height, loadTexture, ScaleMode.StretchToFill);
}
}
You don't have to turn off the camera, but it wouldn't hurt. If you have other GUI elements, they might show up on top of your load screen. You can fix that by setting GUI.depth.
Instead of the flag, it might be more efficient to have a class that does nothing but show the texture, and turn the entire component on and off.
Map the texture you want to display to a plane and then put that in front of the camera. Fade it out when you're done loading (or whatever) and then disable it (to free up a draw-call on an invisible plane)
camera.farClipPlane = 0; this sets the distance it sees to 0 but you wont see anything at all.
if you set it to 0.1 and the near clip to 0 you should see the skybox colour only