Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Preface
Resources Used in This Book
Audience and Approach
Conventions Used in This Book
Using Code Examples
O’Reilly Safari
How to Contact Us
Acknowledgments
I. The Basics of Unity
1. Introducing Unity
Hello, Book
Mobile Games
Hello, Unity
What’s Unity For?
Getting Unity
2. A Tour of Unity
The Editor
Play Mode and Edit Mode
The Scene View
The Mode Selector
Getting Around
Handle Controls
The Hierarchy
The Project View
The Inspector
The Game View
Wrapping Up
3. Scripting in Unity
A Crash Course in C#
Mono and Unity
MonoDevelop
Code completion
Refactoring
Building
Game Objects, Components, and Scripts
The Inspector
Components
Important Methods
Awake and OnEnable
Start
Start Versus Awake
Update and LateUpdate
Coroutines
Creating and Destroying Objects
Instantiation
Creating an Object from Scratch
Destroying Objects
Attributes
RequireComponent
Header and Space
SerializeField and HideInInspector
ExecuteInEditMode
Time in Scripts
Logging to the Console
Wrapping Up
II. Building a 2D Game: Gnome on a Rope
4. Getting Started Building the Game
Game Design
Creating the Project and Importing Assets
Creating the Gnome
Rope
Coding the Rope
Configuring the Rope
Wrapping Up
5. Preparing for Gameplay
Input
Unity Remote
Adding Tilt Control
Creating a Singleton class
Implementing an InputManager Singleton
Controlling the Rope
Making the Camera Follow the Gnome
Scripts and Debugging
Setting breakpoints
Setting Up the Gnome’s Code
Setting Up the Game Manager
Setting Up and Resetting the Game
Creating a New Gnome
Removing the Old Gnome
Killing a gnome
Resetting the Game
Dealing with Touching
Reaching the Exit
Pausing and Unpausing
Handling the Reset Button
Preparing the Scene
Wrapping Up
6. Building Gameplay with Traps and Objectives
Simple Traps
Treasure and Exit
Creating the Exit
Adding a Background
Wrapping Up
7. Polishing the Game
Updating the Gnome’s Art
Updating the Physics
Background
Layers
Creating the Backgrounds
Different Backgrounds
The Bottom of the Well
Updating the Camera
User Interface
Invincibility Mode
Wrapping Up
8. Final Touches on Gnome’s Well
More Traps and Level Objects
Spikes
Spinning Blade
Blocks
Particle Effects
Defining the Particle Material
The Blood Fountain
The Blood Explosion
Using the Particle Systems
Main Menu
Scene Loading
Audio
Wrapping Up and Challenges
III. Building a 3D Game: Space Shooter
9. Building a Space Shooter
Designing the Game
Getting the Assets
Architecture
Creating the Scene
Ship
Camera follow
Space Station
Skybox
Creating the skybox
Canvas
Wrapping Up
10. Input and Flight Control
Input
Adding the Joystick
The Input Manager
Flight Control
Indicators
Creating the UI elements
Indicator Manager
Wrapping Up
11. Adding Weapons and Targeting
Weapons
Ship Weapons
Fire Button
Target Reticle
Wrapping Up
12. Asteroids and Damage
Asteroids
Asteroid Spawner
Damage-Dealing and Taking
Explosions
Wrapping Up
13. Audio, Menus, Death, and Explosions!
Menus
Main Menu
Paused Screen
Game Over Screen
Adding a Pause Button
Game Manager and Death
Start Points
Creating the Game Manager
Initial setup
Starting the game
Ending the game
Pausing the game
Setting Up the Scene
Boundaries
Creating the UI
Coding the Boundary
Final Polish
Space Dust
Trail Renderers
Audio
Spaceship
Weapon effects
Explosions
Wrapping Up
IV. Advanced Features
14. Lighting and Shaders
Materials and Shaders
Fragment-Vertex (Unlit) Shaders
Global Illumination
Light Probes
Thinking About Performance
The Profiler
Getting Data from Your Device
General Tips
Wrapping Up
15. Creating GUIs in Unity
How GUIs Work in Unity
Canvas
RectTransform
The Rect Tool
Anchors
Controls
Events and Raycasts
Responding to Events
Using the Layout System
Scaling the Canvas
Transitioning Between Screens
Wrapping Up
16. Editor Extensions
Making a Custom Wizard
Making a Custom Editor Window
The Editor GUI API
Rects and layout
How controls work
Buttons
Text fields
Delayed text fields
Special text fields
Sliders
Space
Lists
Scroll views
The Asset Database
Making a Custom Property Drawer
Creating the Class
Setting the Height of the Property
Overriding OnGUI
Getting the Properties
Creating a property scope
Drawing the Label
Calculating the Rectangles
Getting the Values
Creating the Change Check
Drawing the Slider
Drawing the Fields
Checking for Changes
Storing the Properties
Testing It Out
Making a Custom Inspector
Creating a Simple Script
Creating a Custom Inspector
Setting Up the Class
Defining the Colors and Properties
Setting Up the Variables
Starting to Draw the GUI
Drawing the Controls
Applying Changes
Testing It Out
Wrapping Up
17. Beyond the Editor
The Unity Services Ecosystem
The Asset Store
PlayMaker
Installing PlayMaker
Playing with PlayMaker
Amplify Shader Editor
UFPS
Unity Cloud Build
Unity Ads
Deployment
Setting Up Your Project
Setting Your Target
Splash screens
Building for Your Platform
Building for iOS
Building for Android
Where to Go from Here
Index
← Prev
Back
Next →
← Prev
Back
Next →