Book description
Develop your first interactive 2D and 3D platformer game by learning the fundamentals of C#
About This Book
- This is a step-by-step guide to learn the fundamentals of C# 7 scripting to develop GameObjects and master the basics of the new UI system in Unity
- Build and develop your 2D game right from scratch while implementing the principles of object-oriented programming and coding in C# 7
- Get to grips with the fundamentals of optimizing your game using the latest features of Unity 2017
Who This Book Is For
The book is targeted at beginner level Unity developers with no programming experience. If you are a Unity developer and you wish to learn how to write C# scripts and code by creating games, then this book is for you.
What You Will Learn
- Learn C# 7 using new features like tuples, variables, and non-nullable reference types while building games
- Understand the fundamentals of variables, methods, and code syntax in C#
- Use loops and collections efficiently in Unity to reduce the amount of code
- Develop a game using the object-oriented programming principles
- Implement simple enemy characters into the game to learn point to point movement and Tree behaviors
- Avoid performance mistakes by implementing different optimization techniques
- Export 3D models and 3D animations and import them inside a Unity project
- With your new knowledge of coding, you will be able to look at Unity's Scripting Reference code examples with confidence
In Detail
With the latest version of Unity 2017 released, are you interested in developing creative and interactive games while learning C# alongside? Then this is the book that you are looking for. Its all about offering you a fun introduction to the world of game programming with C#.
You'll start with the basics to get started with C# 7 and its latest features. Then you'll see how to use C# 7 and its latest functional programming capabilities to create amazing games with Unity 2017.
You'll create your first C# script for Unity, add objects into it, and learn how to create game elements with them. Then you'll work with the latest functional programming features of C# and how to leverage them for great game scripting.
Throughout the book, you'll learn to use the new Unity 2017 2D tool set and create an interactive 2D game with it. You will make enemies appear to challenge your player, and go through some optimization techniques to ensure great game performance. At the end, your 2D game will be transformed into 3D, and you'll be able to skill up to become a pro C# programmer with Unity 2017!
Style and approach
The book takes a practical, step-by-step approach where you learn C# coding while developing fun and interactive games.
Table of contents
- Preface
-
Discovering Your Hidden Scripting Skills and Getting Your Environment Ready
- Prerequisite knowledge to use this book
- Dealing with scriptphobia
- Downloading Unity
- Teaching behavior to GameObjects
- C# documentation – where to find it and do I need it at all?
- Working with C# script files
- Creating a C# script file
-
Introducing the MonoDevelop code editor
- Syncing C# files between MonoDevelop and Unity
- Opening LearningScript in MonoDevelop
- Watching for possible gotchas while creating script files in Unity
- Fixing synchronization if it isn't working properly
- Adding our script to GameObject
- Lots of files can create a mess
- Why does my Project tab look different?
- Instance? What is this?
- Summary
- Introducing the Building Blocks for Unity Scripts
-
Getting into the Details of Variables
- Writing C# statements properly
- Understanding component properties in Unity's Inspector
- Changing a property's value in the Inspector panel
- Private variables
- Naming your variables properly
- Beginning variable names with lowercase
- Using multiword variable names
- Declaring a variable and its type
- Assigning values while declaring a variable
- Where you declare a variable is important
- Variable scope - determining where a variable can be used
- Summary
- Getting into the Details of Methods
- Lists, Arrays, and Dictionaries
- Loops
- Object, a Container with Variables and Methods
- Let's Make a Game! – from Idea to Development
- Starting Your First Game
- Writing GameManager
- The Game Level
- The User Interface
- Collectables
- Enemies
- Audio, 3D Games, and Export
Product information
- Title: Learning C# 7 By Developing Games with Unity 2017 - Third Edition
- Author(s):
- Release date: December 2017
- Publisher(s): Packt Publishing
- ISBN: 9781788478922
You might also like
book
Learning C# by Developing Games with Unity 2021 - Sixth Edition
Learn C# programming from scratch using Unity as a fun and accessible entry point with this …
book
Mastering Unity 2017 Game Development with C# - Second Edition
Master realistic animations and graphics, particle systems, game AI and physics, sprites and VR development with …
book
Learning C# by Developing Games with Unity 2020 - Fifth Edition
Key Features Understand C# programming basics, terminology, and coding best practices Put your knowledge of C# …
book
Developing 2D Games with Unity: Independent Game Programming with C#
Follow a walkthrough of the Unity Engine and learn important 2D-centric lessons in scripting, working with …