Unity 5 for Android Essentials
eBook - ePub

Unity 5 for Android Essentials

  1. 200 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Unity 5 for Android Essentials

Book details
Book preview
Table of contents
Citations

About This Book

A fast-paced guide to building impressive games and applications for Android devices with Unity 5

About This Book

  • Design beautiful effects, animations, physical behaviors, and other different real-world features for your Android games and applications
  • Optimize your project and any other real-world projects for Android devices
  • Follows a tutorial-based approach to learning the best practices for accessing Android functionality, rendering high-end graphics, and expanding your project using Asset Bundles

Who This Book Is For

This book is perfect for competent Unity developers who want to learn how to develop, optimize, and publish games for Android devices in a quick and easy manner. This book assumes basic knowledge of game design concepts and/or some experience with other game technologies such as Unreal Engine 4, CryEngine, or GameMaker.

What You Will Learn

  • Discover tips and tricks to optimize Unity scripts
  • Create Java and native C plugins for the Android platform
  • Access Android features and sensors inside the Unity 5 engine
  • Render high quality graphics and optimize Cg shaders
  • Play Legacy and Mecanim animations in Unity 5
  • Download new assets and code behavior while your game is running on an Android device in order to expand your game in real time
  • Debug your games and applications on Android devices using the Unity Profiler tool

In Detail

Unity is a very popular and effective technology for creating 2D and 3D games and applications. The Unity rendering engine provides great real-time rendering of high quality graphics without too much cost and effort. It boasts industry leading multi-platform support and world class monetization and retention services for mobile games, making it the first choice for many game developers across the world. Unity 5 is a great starting point for game developers looking to develop stunning and robust games.

Starting with a refresher on the basics of Unity 5, this book will take you all the way through to creating your first custom game. By the end of the book, you will understand how to work with all the aspects of Unity 5. You will quickly explore all the major key features of the Unity 5 engine and learn to implement real-world Android game and application features in practice.

We begin by introducing how to set up the Android SDK on Windows and Mac OS X and configure Unity 5 settings for the Android platform. As you progress through the chapters, you will learn to implement innovative and user-friendly features with the aid of real-world examples. You will explore how to render high quality graphics with physically-based shaders and global illumination to enhance your project's performance. Building on this, you will then learn to transform your native C# and JavaScript code into Unity scripts. Best practices to improve your Android games will also be discussed to help you create games fast and efficiently. Finally, putting together all these concepts, you will learn to create your own Android game from scratch.

This book will teach you how to harness the benefits of different tools to become proficient at game design and development processes.

Style and approach

This book is a simple and fast-paced guide that helps you through the process of creating real-world Android games and applications with the Unity engine using step-by-step and practical examples that progressively build upon each other.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Unity 5 for Android Essentials by Valera Cogut in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Games. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784399191
Edition
1

Unity 5 for Android Essentials


Table of Contents

Unity 5 for Android Essentials
Credits
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
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Setting Up and Configuring an Android Platform
Configuring Unity 5 for Android devices
APK expansion files in Unity 5
Overview
Formats
The updating process
Setting up expansion files in Unity 5
Building for Android devices
Unity License Comparison Overview
NavMeshes, pathfinding, and crowd simulation
Level of Detail (LOD) support
Audio filters
Video playback and streaming
Full-fledged streaming with asset bundles
Hundred thousand dollar turnover
Mecanim – IK Rigs
Mecanim – sync layers and additional curves
Custom splash screen
Build size stripping
Lightmapping with global illumination and area lights
HDR and tone mapping
Occlusion culling
Light probes
Static batching
Render-to-texture effects
Fullscreen postprocessing effects
NavMesh – dynamic obstacles and priority
.NET socket support
Profiler and GPU profiling
Real-time directional shadows
Script access to asset pipeline
Summary
2. Accessing Android Functionality
Creating Java and native C plugins for an Android platform
Creating plugins in C
Creating plugins in Java (Eclipse IDE)
Writing Java code in plugin
Turning on and off a hardware flashlight
On Unity side
Exporting and importing a JAR library from Eclipse into Unity
Importing AndroidManifest
Using Java plugins in Unity scripts
Anti-piracy check
Vibration
Activity Indicator
Screen orientation
System information
Accessing the Android sensors and features within Unity 5
Acceleration
Gyroscope
Compass
Summary
3. High-end Graphics for Android Devices
Physically-based shaders
Basic shader concepts
The vertex shader
The geometry shader
The pixel/fragment shader
Shading languages
Cg
Unity shaders in Cg
A custom diffuse lighting model
A basic reflection environment
Masked texture reflection
Lighting model techniques
The Lit sphere model
Realistic rendering
Global illumination
Practicing in shader optimization
Best case practice
Summary
4. Animation, Audio, Physics, and Particle Systems in Unity 5
New Mecanim animation features in Unity 5
State machine behavior
State machine transition
Asset creation API
Direct blend tree
Programmatically creating assets by Unity 5 API
Creating the controller
Adding parameters
Adding state machines
Adding states
Adding transitions
Going deeper into new audio features
Mood transitions
Physics and particle system effects in Unity 5
Particle system performance tips and tricks
Legacy versus Shuriken Unity's built-in particle systems
Particle system tips
Summary
5. Asset Bundles in Unity 5 Pro
An overview of the asset bundles in Unity 5
Downloading new code and data in real time for Android devices
Managing loaded asset bundles
Asset bundles and binary data
Asset bundles and scripts
Asset bundle dependencies
Safeness techniques in practice
Summary
6. Optimization and Transformation Techniques
Occlusion culling and level of detail in optimization techniques
Optimizing by LOD
Unity C# and Unity JS optimization tips and tricks
Transforming Unity C# code into Unity JavaScript code and vice versa
JavaScript variables and types
C# variables and types
Converting types in Unity JS
Converting types in Unity C#
Unity JS function versus Unity C# function
Unity JS return versus Unity C# return
Unity JS yielding versus Unity C# yielding
Unity JS directives versus Unity C# directives
Summary
7. Troubleshooting and Best Practices
Measuring performance with the built-in Android profiler
General CPU activity
Rendering statistics
Detailed Unity player statistics
Detailed script statistics
Detailed statistics on memory allocated by scripts
Debugging Android devices with the Unity profiler tool
Profiler timeline
The CPU area
The Rendering area
The Memory area
The simple view
The detailed view
The audio area
The physics area
The GPU area
Real-practice techniques
The high-speed, off-screen particles technique in Unity
The pool technique
The scriptable profiler tool
Unity profiler tricks
Creating a simple profiler
Summary
Index

Unity 5 for Android Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: August 2015
Production reference: 1310715
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-919-1
www.packtpub.com

Credits

Author
Valera Cogut
Reviewers
Todd Bello
Robbyn Blumenschein
Ali Raza
Joe Whitehouse
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Vinay Argekar
Content Development Editor
Samantha Gonsalves
Technical Editor
Faisal Siddiqui
Copy Editor
Charlotte Carneiro
Project Coordinator
Kinjal Bari
Proofreader
Safis Editing
Indexer
Tejal Soni
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat

About the Author

Valera Cogut is an independent professional software and video game developer who has worked in the game industry since 2008 and has more than 12 years of programming experience. He is a passionate software and game developer with different areas of expertise. Before diving into the game industry 6 years ago, Valera created websites and applications with PHP, the Yii framework, the Zend framework, Relational Database Management Systems, Apache and Nginx, C#, C++, C, Objective-C, Java, Python, UML, and many other technologies. Having a mathematical background (analytical geometry, linear algebra, logic, statistics and probability, differential equations, graph theory, and mathematical analysis), he finally realized that game development was his mission. Reusable designs, optimized algorithms, clean code, and elaborated workflows—these things make him happy.
Valera has had the opportunity to produce titles for multiple platforms, including Windows Phone, Android, iOS, PC, and Mac. Today, he continues to produce fun and original games, participate in game jams, and author books. He was a technical reviewer for Unity Android Game Development by Example Beginner's Guide, Packt Publishing.
Currently, Valera has a contract as a Unity3D C# developer for Kaufcom GmbH, a well-known games and apps producer from Switzerland http://www.kauf.com (Android games: https://play.google.com/store/search?q=kaufcom).

Table of contents

  1. Unity 5 for Android Essentials