Home Page Icon
Home Page
Table of Contents for
Table of Contents
Close
Table of Contents
by Matt Smith, Chico Queiroz
Unity 4.x Cookbook
Unity 4.x Cookbook
Table of Contents
Unity 4.x Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Unity 4.x
Introduction
Installing Unity 4.x
Getting ready...
How to do it...
There's more...
Acquiring new licenses
Setting your preferences
How to do it...
There's more...
Changing the editor's player quality settings
See also
Understanding and optimizing the User Interface
How to do it...
There's more...
See also
Saving assets created in Unity as Prefabs
How to do it...
How it works...
There's more...
Adding external files
Taking your Prefabs to another project
Creating other kinds of game objects
See also
Discovering Unity's content
How to do it...
How it works...
There's more...
Studying the sample project
Downloading more resources
See also
Importing your own content
How to do it...
How it works...
There's more...
Organizing it with the Project view
Exporting your assets to Unity 4.x
See also
Importing Unity packages into your project
How to do it...
How it works...
There's more...
See also
Importing custom packages into your project
Getting ready
How to do it...
How it works...
There's more...
See also
Exporting custom packages from your project
Getting ready
How to do it...
How it works...
See also
Adding custom packages to Unity's quick list
Getting ready
How to do it...
How it works...
There's more...
See also
Using the Project browser
Getting ready
How to do it…
How it works...
See also
2. Using Cameras
Introduction
Creating a picture-in-picture effect
Getting ready
How to do it...
How it works...
There's more...
Making the picture-in-picture proportional to the screen's size
Changing the position of the picture-in-picture
Preventing the picture-in-picture from updating on every frame
See also
Switching between multiple cameras
Getting ready
How to do it...
How it works...
There's more...
Using a single-enabled camera
Triggering the switch from other events
See also
Customizing the lens flare effect
Getting ready
How to do it...
How it works...
There's more...
Making textures from screen content
Getting ready
How to do it...
How it works...
There's more...
Applying your texture to a material
Using your texture as a screenshot
Zooming a telescopic camera
Getting ready
How to do it...
How it works...
There's more...
Making an inspect camera
Getting ready
How to do it...
How it works...
There's more...
Creating particle effects using Shuriken
Getting ready
How to do it...
How it works...
There's more...
Scrubbing back and forward through the particle animation
Learning more from the Unity documentation
Adding effects through Particle Effect
Displaying a mini-map
Getting ready
How to do it...
How it works...
There's more...
Using Render Texture (Pro only)
Adapting your mini-map to other styles
See also
3. Creating Maps and Materials
Introduction
Creating a reflective material
Getting ready
How to do it...
How it works...
There's more...
Using six different texture maps
Experimenting with mapping and shader options
Reflecting actual scene geometry
Creating a self-illuminated material
Getting ready
How to do it...
How it works...
There's more...
Using independent maps
Emitting light over other objects
See also
Creating specular texture maps
Getting ready
How to do it...
How it works...
There's more...
Changing the specular color of our material
Adjusting shininess to focus the highlight
See also
Creating transparency texture maps
Getting ready
How to do it...
How it works...
There's more...
Using Cutouts
Applying Bumped Diffuse
See also
Using cookie textures to simulate a cloudy outdoor
Getting ready
How to do it...
How it works...
There's more...
Creating Spot Light cookies
Creating Point Light cookies
Creating a color selection dialog
Getting ready
How to do it...
How it works...
There's more...
Combining textures in real time through the GUI
Getting ready
How to do it...
How it works...
There's more...
See also
Highlighting materials at mouse over
Getting ready
How to do it...
How it works...
There's more...
Highlighting with self-illuminated shaders
Using transparent shaders
Animating textures by looping through array of materials (for example, simulated video)
Getting ready
How to do it...
How it works...
There's more...
Using materials rather than Texture2D images
See also
Disabling culling for a material
Getting ready
How to do it...
How it works...
There's more...
Learning more about shaders
Solving the problem by editing the object's geometry
See also
4. Creating GUIs
Introduction
Displaying a digital clock
How to do it...
How it works...
There's more...
Converting to a 12-hour clock
See also
Displaying an analogue clock
How to do it...
How it works...
There's more...
Configuring a screen corner clock camera
See also
Displaying a compass to show player direction
Getting ready
How to do it...
How it works...
See also
Displaying a radar to indicate relative locations of objects
Getting ready
How to do it...
How it works...
Displaying radar in the OnGUI() method
Displaying radar object icons in the DrawBlip()method
There's more...
Different colored "blips" for different objects
See also
Displaying images for corresponding integers
Getting ready
How to do it...
How it works...
There's more...
Choosing between GUI layout alternatives: GUILayout versus GUI
See also
Displaying images for corresponding floats and ranges
Getting ready
How to do it...
How it works...
There's more...
Cleaning up code with an array of textures
See also
Displaying a digital countdown timer
How to do it...
How it works...
See also
Displaying a countdown timer graphically (5, 4, 3, 2, 1 – blast off)
Getting ready
How to do it...
How it works...
See also
Displaying a countdown timer graphically as a pie-chart style clock
Getting ready
How to do it...
How it works...
There's more...
Creating your own images with a spreadsheet
See also
Creating a message that fades away
How to do it...
How it works...
There's more...
Facilitating several messages by using a prefab
Improving efficiency by re-using a single GUIText message
Displaying inventory texts for single object pickups
Getting ready
How to do it...
How it works...
There's more...
Comparing the gameObject tag with a string special method
See also...
Displaying inventory icons for single object pickups
Getting ready
How to do it...
How it works...
See also
Managing inventories with a general purpose PickUp class
Getting ready
How to do it...
How it works...
There's more...
Responding to non-display pickups
Removing items from the List<> collection
See also
Controlling the scrollbar with the mouse wheel
How to do it...
How it works...
There's more...
Implementing custom mouse cursor icons
Getting ready
How to do it...
How it works...
5. Controlling Animations
Introduction
Configuring a character's Avatar and Idle animation
Getting ready
How to do it...
How it works...
There's more...
Moving your character with Root Motion and Blend Trees
Getting ready
How to do it...
How it works...
There's more...
Mixing animations with Layers and Masks
Getting ready
How to do it...
How it works...
There's more...
Overriding Root Motion via script
Getting ready
How to do it...
How it works...
There's more...
Adding rigid props to animated characters
Getting ready
How to do it...
How it works...
There's more...
Making an animated character throw an object
Getting ready
How to do it...
How it works...
Applying ragdoll physics to a character
Getting ready
How to do it...
How it works...
There's more...
Rotating the character's torso to aim
Getting ready
How to do it...
How it works...
There's more...
6. Playing and Manipulating Sounds
Introduction
Matching audio pitch to animation speed
Getting ready
How to do it...
How it works...
There's more...
Changing the Animation / Sound Ratio parameter
Adding customizable volume controls
Getting ready
How to do it...
How it works...
There's more...
Using a single volume bar
Bypassing the Esc key
See also
Simulating a tunnel environment with Reverb Zones
Getting ready
How to do it...
How it works...
There's more...
Attaching the Audio Reverb Zone component to audio sources
Making your own Reverb settings
Preventing the AudioClip from restarting if already playing
Getting ready
How to do it...
How it works...
See also
Waiting for audio to finish before auto-destructing an object
Getting ready
How to do it...
How it works...
See also
Making a dynamic soundtrack
Getting ready
How to do it...
How it works...
There's more...
Hiding the triggers
Dealing with audio file formats and compression rates
Using 2D sound
7. Working with External Resource Files and Devices
Introduction
Loading external resource files – by Unity Default Resources
Getting ready
How to do it...
How it works...
There's more...
Loading text files with this method
Loading and playing audio files with this method
See also
Loading external resource files – by manually storing files in Unity's Resources folder
Getting ready
How to do it...
How it works...
There's more...
Avoiding cross-platform problems with Path.Combine() rather than "/" or ""
Loading a text file using this approach
WWW and resource contents
See also
Loading external resource files – by downloading files from the Internet
Getting ready
How to do it...
How it works...
See also
Saving and loading player data – using static properties
Getting ready
How to do it...
How it works...
See also
Saving and loading player data – using PlayerPrefs
Getting ready
How to do it...
How it works...
See also
Saving screenshots from the game
Getting ready
How to do it...
How it works...
There's more...
Control characters in Unity with the Microsoft Kinect using the Zigfu samples
Getting ready
How to do it...
How it works...
See also
Animating your own characters with the Microsoft Kinect controller
Getting ready
How to do it...
How it works...
There's more...
Completing your block character
See also
Homemade mocap by storing movements from the Microsoft Kinect controller
Getting ready
How to do it...
How it works...
There's more...
Recording movements of multiple body parts
See also
Setting up a leaderboard using PHP/MySQL
Getting ready
How to do it...
How it works...
There's more...
Extract the full leaderboard data as XML for display within Unity
Using secret game codes to secure your leaderboard scripts
See also
8. Working with External Text Files and XML Data
Introduction
Loading external text files using the TextAsset public variable
Getting ready
How to do it...
How it works...
Loading external text files using C# file streams
Getting ready
How to do it...
How it works...
Saving external text files with C# file streams
Getting ready
How to do it...
How it works...
There's more...
Choosing the Data or the Resources folder
Loading and parsing external XML files
Getting ready
How to do it...
How it works...
There's more...
Retrieving XML data files from the web
Creating XML text data manually using XMLWriter
How to do it...
How it works...
There's more...
Adding newlines to make XML strings more human readable
Making data class responsible for creating XML from list
Creating XML text data automatically through serialization
Getting ready
How to do it...
How it works...
There's more...
Protecting member properties with accessor methods
Creating XML text files – saving XML directly to text files with XMLDocument.Save()
How to do it...
How it works...
9. Managing Object States and Controlling Their Movements
Introduction
Controlling cube movement through player controls
How to do it...
How it works...
See also
Controlling object look-at behavior
Getting ready
How to do it...
How it works...
See also
Controlling object-to-object movements (seek, flee, follow at a distance)
Getting ready
How to do it...
How it works...
There's more...
Using the simpler (and less sophisticated) MoveTowards() method
Improving arrival behavior through deceleration when near target
Implementing flee target and follow at a distance
See also
Controlling object group movement through flocking
Getting ready
How to do it...
How it works...
See also
Firing objects by instantiation with forward velocity
Getting ready
How to do it...
How it works...
There's more...
Addressing efficiency issues with FindGameObjectsWithTag()
See also
Finding a random spawn point
Getting ready
How to do it...
How it works...
See also
Finding the nearest spawn point
Getting ready
How to do it...
How it works...
See also
Following waypoints in a sequence
Getting ready
How to do it...
How it works...
See also
Managing object behavior with states
How to do it...
How it works...
See also
Managing complex object behavior with the state pattern
How to do it...
How it works...
See also
10. Improving Games with Extra Features and Optimization
Introduction
Pausing the game
Getting ready
How to do it...
How it works...
There's more...
Learning more about quality settings
See also
Implementing slow motion
Getting ready
How to do it...
How it works...
There's more...
Adding Motion Blur (Unity Pro only)
Creating sonic ambience
See also
Implementing 3D stereography with polarized projection
Getting ready
How to do it...
How it works...
There's more...
Using Render to Texture (Unity Pro only)
Using anaglyph resources
Using NVidia 3D Vision
Acquiring active stereo third-party software
Preventing your game from running on unknown servers
Getting ready
How to do it...
How it works...
There's more...
Improving security by using full URLs in your Domain List
Allowing redistribution with more domains
Identifying performance "bottlenecks" with code profiling
Getting ready
How to do it...
How it works...
There's more...
Unity Pro only – code profiling
Reducing the number of objects by destroying objects at a "death" time
How to do it...
How it works...
See also
Reducing the number of enabled objects by disabling objects whenever possible
How to do it...
How it works...
There's more...
Another common case – only enable after OnTrigger()
Going one step further – make the parent GameObject inactive
See also
Improving efficiency with delegates and events (and avoiding SendMessage!)
How to do it...
How it works...
Executing methods regularly but independent of frame rate with coroutines
How to do it...
How it works...
There's more...
Have different actions happening at different intervals
See also
Spreading long computations over several frames with coroutines
How to do it...
How it works...
There's more...
Retrieving the complete Unity log text files from your system
See also
Caching, rather than component lookups and "reflection" over objects
Getting ready
How to do it...
How it works...
11. Taking Advantage of Unity Pro
Introduction
Dynamically focusing objects with Depth of Field
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a rearview mirror
Getting ready
How to do it...
How it works...
There's more...
Adding details
Using Render Texture as a TV screen
Playing videos inside a scene
Getting ready
How to do it...
How it works...
There's more...
Simulating underwater ambience with audio filters
Getting ready
How to do it...
How it works...
There's more...
Keeping the Cutoff Frequency unchanged
Adding more filters
See also
Loading and playing external movie files
Getting ready
How to do it...
How it works...
There's more...
Loading videos from the Internet
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Unity 4.x Cookbook
Table of Contents
Unity 4.x Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Unity 4.x
Introduction
Installing Unity 4.x
Getting ready...
How to do it...
There's more...
Acquiring new licenses
Setting your preferences
How to do it...
There's more...
Changing the editor's player quality settings
See also
Understanding and optimizing the User Interface
How to do it...
There's more...
See also
Saving assets created in Unity as Prefabs
How to do it...
How it works...
There's more...
Adding external files
Taking your Prefabs to another project
Creating other kinds of game objects
See also
Discovering Unity's content
How to do it...
How it works...
There's more...
Studying the sample project
Downloading more resources
See also
Importing your own content
How to do it...
How it works...
There's more...
Organizing it with the Project view
Exporting your assets to Unity 4.x
See also
Importing Unity packages into your project
How to do it...
How it works...
There's more...
See also
Importing custom packages into your project
Getting ready
How to do it...
How it works...
There's more...
See also
Exporting custom packages from your project
Getting ready
How to do it...
How it works...
See also
Adding custom packages to Unity's quick list
Getting ready
How to do it...
How it works...
There's more...
See also
Using the Project browser
Getting ready
How to do it…
How it works...
See also
2. Using Cameras
Introduction
Creating a picture-in-picture effect
Getting ready
How to do it...
How it works...
There's more...
Making the picture-in-picture proportional to the screen's size
Changing the position of the picture-in-picture
Preventing the picture-in-picture from updating on every frame
See also
Switching between multiple cameras
Getting ready
How to do it...
How it works...
There's more...
Using a single-enabled camera
Triggering the switch from other events
See also
Customizing the lens flare effect
Getting ready
How to do it...
How it works...
There's more...
Making textures from screen content
Getting ready
How to do it...
How it works...
There's more...
Applying your texture to a material
Using your texture as a screenshot
Zooming a telescopic camera
Getting ready
How to do it...
How it works...
There's more...
Making an inspect camera
Getting ready
How to do it...
How it works...
There's more...
Creating particle effects using Shuriken
Getting ready
How to do it...
How it works...
There's more...
Scrubbing back and forward through the particle animation
Learning more from the Unity documentation
Adding effects through Particle Effect
Displaying a mini-map
Getting ready
How to do it...
How it works...
There's more...
Using Render Texture (Pro only)
Adapting your mini-map to other styles
See also
3. Creating Maps and Materials
Introduction
Creating a reflective material
Getting ready
How to do it...
How it works...
There's more...
Using six different texture maps
Experimenting with mapping and shader options
Reflecting actual scene geometry
Creating a self-illuminated material
Getting ready
How to do it...
How it works...
There's more...
Using independent maps
Emitting light over other objects
See also
Creating specular texture maps
Getting ready
How to do it...
How it works...
There's more...
Changing the specular color of our material
Adjusting shininess to focus the highlight
See also
Creating transparency texture maps
Getting ready
How to do it...
How it works...
There's more...
Using Cutouts
Applying Bumped Diffuse
See also
Using cookie textures to simulate a cloudy outdoor
Getting ready
How to do it...
How it works...
There's more...
Creating Spot Light cookies
Creating Point Light cookies
Creating a color selection dialog
Getting ready
How to do it...
How it works...
There's more...
Combining textures in real time through the GUI
Getting ready
How to do it...
How it works...
There's more...
See also
Highlighting materials at mouse over
Getting ready
How to do it...
How it works...
There's more...
Highlighting with self-illuminated shaders
Using transparent shaders
Animating textures by looping through array of materials (for example, simulated video)
Getting ready
How to do it...
How it works...
There's more...
Using materials rather than Texture2D images
See also
Disabling culling for a material
Getting ready
How to do it...
How it works...
There's more...
Learning more about shaders
Solving the problem by editing the object's geometry
See also
4. Creating GUIs
Introduction
Displaying a digital clock
How to do it...
How it works...
There's more...
Converting to a 12-hour clock
See also
Displaying an analogue clock
How to do it...
How it works...
There's more...
Configuring a screen corner clock camera
See also
Displaying a compass to show player direction
Getting ready
How to do it...
How it works...
See also
Displaying a radar to indicate relative locations of objects
Getting ready
How to do it...
How it works...
Displaying radar in the OnGUI() method
Displaying radar object icons in the DrawBlip()method
There's more...
Different colored "blips" for different objects
See also
Displaying images for corresponding integers
Getting ready
How to do it...
How it works...
There's more...
Choosing between GUI layout alternatives: GUILayout versus GUI
See also
Displaying images for corresponding floats and ranges
Getting ready
How to do it...
How it works...
There's more...
Cleaning up code with an array of textures
See also
Displaying a digital countdown timer
How to do it...
How it works...
See also
Displaying a countdown timer graphically (5, 4, 3, 2, 1 – blast off)
Getting ready
How to do it...
How it works...
See also
Displaying a countdown timer graphically as a pie-chart style clock
Getting ready
How to do it...
How it works...
There's more...
Creating your own images with a spreadsheet
See also
Creating a message that fades away
How to do it...
How it works...
There's more...
Facilitating several messages by using a prefab
Improving efficiency by re-using a single GUIText message
Displaying inventory texts for single object pickups
Getting ready
How to do it...
How it works...
There's more...
Comparing the gameObject tag with a string special method
See also...
Displaying inventory icons for single object pickups
Getting ready
How to do it...
How it works...
See also
Managing inventories with a general purpose PickUp class
Getting ready
How to do it...
How it works...
There's more...
Responding to non-display pickups
Removing items from the List<> collection
See also
Controlling the scrollbar with the mouse wheel
How to do it...
How it works...
There's more...
Implementing custom mouse cursor icons
Getting ready
How to do it...
How it works...
5. Controlling Animations
Introduction
Configuring a character's Avatar and Idle animation
Getting ready
How to do it...
How it works...
There's more...
Moving your character with Root Motion and Blend Trees
Getting ready
How to do it...
How it works...
There's more...
Mixing animations with Layers and Masks
Getting ready
How to do it...
How it works...
There's more...
Overriding Root Motion via script
Getting ready
How to do it...
How it works...
There's more...
Adding rigid props to animated characters
Getting ready
How to do it...
How it works...
There's more...
Making an animated character throw an object
Getting ready
How to do it...
How it works...
Applying ragdoll physics to a character
Getting ready
How to do it...
How it works...
There's more...
Rotating the character's torso to aim
Getting ready
How to do it...
How it works...
There's more...
6. Playing and Manipulating Sounds
Introduction
Matching audio pitch to animation speed
Getting ready
How to do it...
How it works...
There's more...
Changing the Animation / Sound Ratio parameter
Adding customizable volume controls
Getting ready
How to do it...
How it works...
There's more...
Using a single volume bar
Bypassing the Esc key
See also
Simulating a tunnel environment with Reverb Zones
Getting ready
How to do it...
How it works...
There's more...
Attaching the Audio Reverb Zone component to audio sources
Making your own Reverb settings
Preventing the AudioClip from restarting if already playing
Getting ready
How to do it...
How it works...
See also
Waiting for audio to finish before auto-destructing an object
Getting ready
How to do it...
How it works...
See also
Making a dynamic soundtrack
Getting ready
How to do it...
How it works...
There's more...
Hiding the triggers
Dealing with audio file formats and compression rates
Using 2D sound
7. Working with External Resource Files and Devices
Introduction
Loading external resource files – by Unity Default Resources
Getting ready
How to do it...
How it works...
There's more...
Loading text files with this method
Loading and playing audio files with this method
See also
Loading external resource files – by manually storing files in Unity's Resources folder
Getting ready
How to do it...
How it works...
There's more...
Avoiding cross-platform problems with Path.Combine() rather than "/" or ""
Loading a text file using this approach
WWW and resource contents
See also
Loading external resource files – by downloading files from the Internet
Getting ready
How to do it...
How it works...
See also
Saving and loading player data – using static properties
Getting ready
How to do it...
How it works...
See also
Saving and loading player data – using PlayerPrefs
Getting ready
How to do it...
How it works...
See also
Saving screenshots from the game
Getting ready
How to do it...
How it works...
There's more...
Control characters in Unity with the Microsoft Kinect using the Zigfu samples
Getting ready
How to do it...
How it works...
See also
Animating your own characters with the Microsoft Kinect controller
Getting ready
How to do it...
How it works...
There's more...
Completing your block character
See also
Homemade mocap by storing movements from the Microsoft Kinect controller
Getting ready
How to do it...
How it works...
There's more...
Recording movements of multiple body parts
See also
Setting up a leaderboard using PHP/MySQL
Getting ready
How to do it...
How it works...
There's more...
Extract the full leaderboard data as XML for display within Unity
Using secret game codes to secure your leaderboard scripts
See also
8. Working with External Text Files and XML Data
Introduction
Loading external text files using the TextAsset public variable
Getting ready
How to do it...
How it works...
Loading external text files using C# file streams
Getting ready
How to do it...
How it works...
Saving external text files with C# file streams
Getting ready
How to do it...
How it works...
There's more...
Choosing the Data or the Resources folder
Loading and parsing external XML files
Getting ready
How to do it...
How it works...
There's more...
Retrieving XML data files from the web
Creating XML text data manually using XMLWriter
How to do it...
How it works...
There's more...
Adding newlines to make XML strings more human readable
Making data class responsible for creating XML from list
Creating XML text data automatically through serialization
Getting ready
How to do it...
How it works...
There's more...
Protecting member properties with accessor methods
Creating XML text files – saving XML directly to text files with XMLDocument.Save()
How to do it...
How it works...
9. Managing Object States and Controlling Their Movements
Introduction
Controlling cube movement through player controls
How to do it...
How it works...
See also
Controlling object look-at behavior
Getting ready
How to do it...
How it works...
See also
Controlling object-to-object movements (seek, flee, follow at a distance)
Getting ready
How to do it...
How it works...
There's more...
Using the simpler (and less sophisticated) MoveTowards() method
Improving arrival behavior through deceleration when near target
Implementing flee target and follow at a distance
See also
Controlling object group movement through flocking
Getting ready
How to do it...
How it works...
See also
Firing objects by instantiation with forward velocity
Getting ready
How to do it...
How it works...
There's more...
Addressing efficiency issues with FindGameObjectsWithTag()
See also
Finding a random spawn point
Getting ready
How to do it...
How it works...
See also
Finding the nearest spawn point
Getting ready
How to do it...
How it works...
See also
Following waypoints in a sequence
Getting ready
How to do it...
How it works...
See also
Managing object behavior with states
How to do it...
How it works...
See also
Managing complex object behavior with the state pattern
How to do it...
How it works...
See also
10. Improving Games with Extra Features and Optimization
Introduction
Pausing the game
Getting ready
How to do it...
How it works...
There's more...
Learning more about quality settings
See also
Implementing slow motion
Getting ready
How to do it...
How it works...
There's more...
Adding Motion Blur (Unity Pro only)
Creating sonic ambience
See also
Implementing 3D stereography with polarized projection
Getting ready
How to do it...
How it works...
There's more...
Using Render to Texture (Unity Pro only)
Using anaglyph resources
Using NVidia 3D Vision
Acquiring active stereo third-party software
Preventing your game from running on unknown servers
Getting ready
How to do it...
How it works...
There's more...
Improving security by using full URLs in your Domain List
Allowing redistribution with more domains
Identifying performance "bottlenecks" with code profiling
Getting ready
How to do it...
How it works...
There's more...
Unity Pro only – code profiling
Reducing the number of objects by destroying objects at a "death" time
How to do it...
How it works...
See also
Reducing the number of enabled objects by disabling objects whenever possible
How to do it...
How it works...
There's more...
Another common case – only enable after OnTrigger()
Going one step further – make the parent GameObject inactive
See also
Improving efficiency with delegates and events (and avoiding SendMessage!)
How to do it...
How it works...
Executing methods regularly but independent of frame rate with coroutines
How to do it...
How it works...
There's more...
Have different actions happening at different intervals
See also
Spreading long computations over several frames with coroutines
How to do it...
How it works...
There's more...
Retrieving the complete Unity log text files from your system
See also
Caching, rather than component lookups and "reflection" over objects
Getting ready
How to do it...
How it works...
11. Taking Advantage of Unity Pro
Introduction
Dynamically focusing objects with Depth of Field
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a rearview mirror
Getting ready
How to do it...
How it works...
There's more...
Adding details
Using Render Texture as a TV screen
Playing videos inside a scene
Getting ready
How to do it...
How it works...
There's more...
Simulating underwater ambience with audio filters
Getting ready
How to do it...
How it works...
There's more...
Keeping the Cutoff Frequency unchanged
Adding more filters
See also
Loading and playing external movie files
Getting ready
How to do it...
How it works...
There's more...
Loading videos from the Internet
Index
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset