Unity 3.x Game Development Essentials
eBook - ePub

Unity 3.x Game Development Essentials

Game development with C# and Javascript

Will Goldstone

Buch teilen
  1. 488 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Unity 3.x Game Development Essentials

Game development with C# and Javascript

Will Goldstone

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

In Detail

Game Engines such as Unity are the power-tools behind the games we know and love. Unity is one of the most widely-used and best loved packages for game development and is used by everyone, from hobbyists to large studios, to create games and interactive experiences for the web, desktop, mobile, and console. With Unity's intuitive, easy to learn toolset and this book - it's never been easier to become a game developer.

Taking a practical approach, this book will introduce you to the concepts of developing 3D games, before getting to grips with development in Unity itself - prototyping a simple scenario, and then creating a larger game. From creating 3D worlds to scripting and creating game mechanics you will learn everything you'll need to get started with game development.

This book is designed to cover a set of easy-to-follow examples, which culminate in the production of a First Person 3D game, complete with an interactive island environment. All of the concepts taught in this book are applicable to other types of game, however, by introducing common concepts of game and 3D production, you'll explore Unity to make a character interact with the game world, and build puzzles for the player to solve, in order to complete the game. At the end of the book, you will have a fully working 3D game and all the skills required to extend the game further, giving your end-user, the player, the best experience possible. Soon you will be creating your own 3D games with ease!

Approach

This book follows an informal, demystifying approach to the world of game development with the Unity game engine. With no prior knowledge of game development or 3D required, you will learn from scratch, taking each concept at a time working up to a full 3D mini-game. You'll learn scripting with C# or JavaScript and master the Unity development environment with easy-to-follow stepwise tasks.

Who this book is for

If you're a designer or animator who wishes to take their first steps into game development or prototyping, or if you've simply spent many hours sitting in front of video games, with ideas bubbling away in the back of your mind, Unity and this book should be your starting point. No prior knowledge of game production is required, inviting you to simply bring with you a passion for making great games.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Unity 3.x Game Development Essentials als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Unity 3.x Game Development Essentials von Will Goldstone im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatica & Programmazione in C#. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2011
ISBN
9781849691444

Unity 3.xGame Development Essentials

Game development with C# and Javascript


Table of Contents

Unity 3.x Game Development Essentials
Credits
Foreword
About the Author
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
Getting help with the book and updates
Conventions
Reader feedback
Customer support
Downloading the book asset bundle
Downloading the color images of this book
Errata
Piracy
Questions
1. Enter the Third Dimension
Getting to grips with 3D
Coordinates
Local space versus world space
Vectors
Cameras
Projection mode—3D versus 2D
Polygons, edges, vertices, and meshes
Materials, textures, and shaders
Rigidbody physics
Collision detection
Essential Unity concepts
The Unity way—an example
Assets
Scenes
GameObjects
Components
Scripts
Prefabs
The interface
The Scene view and Hierarchy
Control tools
Flythrough Scene navigation
Control bar
Search box
Create button
The Inspector
The Project window
The Game view
Summary
2. Prototyping and Scripting Basics
Your first Unity project
A basic prototyping environment
Setting the scene
Adding simple lighting
Another brick in the wall
Building the master brick
And snap!—It's a row
Grouping and duplicating with empty objects
Build it up, knock it down!
Setting the viewpoint
Introducing scripting
A new behaviour script or 'class'
What's inside a new C# behaviour
Basic functions
Variables in C#
What's inside a new Javascript behaviour
Variables in Javascript
Comments
Wall attack
Declaring public variables
Assigning scripts to objects
Moving the camera
Local, private, and public variables
Local variables and receiving input
Understanding Translate
Implementing Translate
Testing the game so far
Making a projectile
Creating the projectile prefab
Creating and applying a material
Adding physics with a Rigidbody
Storing with prefabs
Firing the projectile
Using Instantiate() to spawn objects
Adding a force to the Rigidbody
Summary
3. Creating the Environment
Designing the game
Using the terrain editor
Terrain menu features
Importing and exporting heightmaps
Setting the resolution
Mass place trees
Flatten Heightmap
Refresh tree and detail prototypes
The terrain toolset
Terrain Script
Raise height
Paint height
Smooth Height
Paint Texture
Place Trees
Paint Details
Terrain Settings
Creating the island—sun, sea, and sand
Step 1—Setting up the terrain
Step 2—Creating the Island outline
Step 3—Volcano!
Step 4—Adding textures
Painting procedure
Sandy areas
Grass & Rock
Volcanoes rock!
Step 5—Tree time
Step 6—The grass is always greener
Step 7—Let there be lights!
Creating sunlight
Step 8—What's that sound?
Sounds—2D versus 3D
Audio file formats
The hills are alive!
Importing the book's asset package
Further audio settings
Step 9—Look, there! Up in the skybox!
Step 10—Open water
Step 11—Going walkabout
Step 12—Final tweaks
Summary
4. Player Characters and Further Scripting
Working with the Inspector
Tags
Layers
Prefabs and the Inspector
Anatomy of a character
Deconstructing the First Person Controller object
Parent-child issues
First Person Controller object
Object 1: First Person Controller (parent)
Transform
Character Controller
Mouse Look (Script)
Character Motor (Script)
FPSInput Controller (Script)
Object 2: Graphics (child)
Mesh filter
Mesh Renderer
Object 3: Main Camera (child)
Camera
GUILayer and Flare Layer
Mouse Look (Script)
Audio listener
Further scripting
Commands
Variables
Variable data types
Using variables
Public versus private variables
Declaring public and private variables
Full example
Functions
Update()
OnMouseDown()
Writing custom functions
Return type
Arguments
Declaring a custom function
Calling a custom function
If else statements
C#:
Multiple conditions
For loops
Inter-script communication and Dot Syntax
Accessing other objects
Find() and FindWithTag()
SendMessage
GetComponent
Programming for Mobile
Dot Syntax
Comments
Further reading
Scripting for character movement
Deconstructing the script
Full script (Javascript)
Variable declaration
Storing movement information
Moving the character
Checking grounded
@Script commands
Summary
5. Interactions
External modeling applications
Common settings for models
Meshes
Normals and Tangents
Materials
Animations
Animation Compression
Setting up the outpost model
Adding the outpost
Positioning
Rotation
Adding colliders
Adding the Rigidbody
Adding audio
Disabling automatic animation
Collisions and triggers
Ray casting
The frame miss
Predictive collision detection
Opening the outpost
Approach 1—Collision detection
Creating new assets
Scripting for character collision detection
Working with OnControllerColliderHit
OpenDoor() custom function
Declaring the function
Checking door status
Playing audio
Testing the script
Extending colliders
Playing animation
Reversing the procedure
Code maintainability
Drawbacks of collision detection
Approach 2—Ray casting
Disabling collision detection with comments
Migrating code—writing a DoorManag...

Inhaltsverzeichnis