Game Development Reference
In-Depth Information
Once a prefab is populated, it can be placed within the scene, copied and
pasted there, and all the copies will be tied to this prefab. If any of the
instances of the prefab are altered, those changes can be inherited to all other
instances of the prefab.
Sometimes, building scenes with combinations of imported assets and
prefabs can save huge amounts of time. Consider how the Hallway scene
included in the downloadable assets was built.
The main body of the hallway was created in Maya and combined (mostly)
into one object so the drawcalls remained low. This did not include any
of the light fixtures or the cameras. The light fixtures (the hanging lights
and the mounted lights) were modeled in Maya and exported individually
and brought into Unity. Once inside of Unity, a new prefab for the hanging
lights was created and a Unity light source (a spotlight) was added.
Then this prefab was placed, copied/pasted, and placed throughout the
model. When the lighting was being worked out, the color balance of
the light could be changed on one light, applied, and then automatically
updated everywhere. Even things like specifications of a light's angle or
shadow characteristics were quickly distributed throughout the model by
adjusting just one.
A similar flow happened with the CCTV camera. The camera was modeled
in Maya and brought into Unity. Within Unity, a new prefab was created
and the CCTV camera was added to it. Then, the LED light was created
from a Unity sphere and organized so it would be the raycasting agent.
The cameras were placed throughout the scene in Unity. As we work
to increase the functionality of these cameras, we only need add the
functionality to one, apply the change, and all the placed cameras will
instantly become smarter.
Even if you're creating your own cameras, take a minute and download and
install the CCTV_Cameras Unity package available on the supporting web
site ( http://www.Creating3dGames.com ). Once these are within the project
file, you'll have all the tools to take some dumb GameObjects and make them
aware of all sorts of things.
So let's make them smarter.
Tips and Tricks
If you are working from your own assets, you'll need to model a camera.
Or, even if you are working from your own Hallway assets, for time-
saving's sake, use the CCTV that is within the Scenography Assets folder
(specifically the Hallway_CCTV_Prefab). Place and organize the camera
prefab. Of course, if you're using the provided assets from the Hallway
package, the cameras are already placed.
 
Search WWH ::




Custom Search