Unity 3.x Game Development Essentials
eBook - ePub

Unity 3.x Game Development Essentials

Game development with C# and Javascript

Will Goldstone

Compartir libro
  1. 488 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Unity 3.x Game Development Essentials

Game development with C# and Javascript

Will Goldstone

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Unity 3.x Game Development Essentials un PDF/ePUB en línea?
Sí, puedes acceder a Unity 3.x Game Development Essentials de Will Goldstone en formato PDF o ePUB, así como a otros libros populares de Informatica y Programmazione in C#. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2011
ISBN
9781849691444
Edición
1
Categoría
Informatica

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...

Índice