Book Image

Mastering Unity Scripting

By : Alan Thorn
Book Image

Mastering Unity Scripting

By: Alan Thorn

Overview of this book

Table of Contents (17 chapters)
Mastering Unity Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Skybox


The Skybox might seem a strange place to begin an analysis of 2D, but it demonstrates an important feature set for cameras, specifically layering. The Skybox is essentially a cube-based background that's attached to a camera to show clouds, skies, and other distant details that should always act as the backdrop to a scene, but it never represents anything that the player can move close to. It is always distant, as shown here:

Skybox assets display a sky background for cameras

The main problem with the default Skyboxes native to Unity is that they remain static and motionless by default. Most developers, however, want their skies and clouds to gently rotate, even when the camera is standing motionless, to portray the procession of a day or of time passing. Now, let's create an improved Skybox prefab using the Unity Skybox assets, two layered cameras, and a C# script file.

Tip

The final project for a rotating Skybox can be found in the book's companion files.

For the sample project created...