Setting the scene with a skybox
Our game environment should be dark, creepy, and suspenseful. However, every new Unity scene is created with a default, procedural skybox representing a cheery daytime exterior; this needs to be changed. A skybox is ultimately a cube with a flipped normal that surround and encompass the environment. Its faces contain an environment texture which, when mapped correctly, appears seamlessly across the model, creating the look of a vast skyline surrounding the scene. The primary purpose of our skybox should be to set a base and ambient lighting. The most appropriate skybox for our usage, then, is a night skybox or, at least, a dark, stormy (and perhaps slightly alien) skybox. There are many ways to create a skybox in Unity. One method is to create a cube-map texture (six separate textures) inside the image-editing software that maps to the faces of a cube. Another method, available in Unity 5, is a procedural skybox. Using this, Unity generates a skybox from some initial creation parameters that we can set through a material.
Let's use the latter, most customizable method. To do this, open the Material folder in the Project panel and create a new material. Assign it a meaningful name; I've used matNight:
Some may question whether prefixes are needed if folders are used. After all, can't you just name your materials anything you wanted, and simply group them together in the same folder, as opposed to using prefixes? In short, use folders to organize and group textures, but name prefixes are still important because assets from different folders can still be viewed together in a consolidate display, when running searches and filters. Also, in these cases, you'll still want to arrange search results alphabetically.
Newly created materials are configured as a Standard shader (PBR material) using the metallic-roughness workflow. This isn't necessary for a skybox, as it doesn't cast light in the same way and isn't affected by shadows and other light sources. Change the material type to Skybox | Procedural. Multiple skyboxes are available, but only a procedural skybox gives you out-of-the-box runtime control over the colors and construction of the texture.
PBR stands for Physically Based Rendering. In Unity, this corresponds to the Standard Shader. This is a special material configured to simulate real-world properties. By using the Standard Shader you can create materials within real-world limits and that react to light as you would expect. The primary purpose of PBR materials to simplify the creation of photo-realistic worlds.
Now, let's configure the material properties. By default, the skybox is generated as a daytime sky. We'll need to change that; set the Sun field to None, as we won't need one, set the Sun Size to 0, Atmospheric Thicknes to 0.43, and Exposure to 1.3; this adds volume and a horizon glow to the environment. In addition, set the sky and ground colors; these should be dark values to express a nightscape. I've chosen 021643FF for Sky Tint and 1D1A19FF for Ground:
The skybox can be applied to the scene in several ways. One way is to assign the skybox to a camera as a background. To do this, simply select a camera, and from the Component menu, add a Skybox component. Navigate to Component | Rendering | Skybox. However, for our purposes, we'll avoid this method. We want the background to apply to the scene, and all cameras, as opposed to a single camera:
Instead of applying a skybox to a camera, we'll apply it to the scene. To do that, open the Lighting window by navigating to Window | Lighting from the application menu. From the Lighting window, drag and drop the newly created skybox material to the Skybox field:
When the skybox is applied via the Lighting window, it should appear from the Scene tab as the world background. If it doesn't appear, ensure that you enable Effects Visibility from the Scene toolbar: