Book description
Learn advanced C# tips and techniques to make professional-grade games with Unity
In Detail
This book is an easy-to-follow guide that introduces you to advanced tips and techniques to code Unity games in C#. Using practical and hands-on examples across ten comprehensive chapters, you'll learn how C# can be applied creatively to build professional-grade games that sell.
You will be able to create impressive Artificial Intelligence for enemy characters, customize camera rendering for postprocess effects, and improve scene management by understanding component-based architecture. In addition, you will have an in-depth look at the .NET classes used to increase program reliability, see how to process datasets such as CSV files, and understand how to run advanced queries on data. By the end of this book, you'll become a powerful Unity developer, equipped with plenty of tools and techniques to quickly and effectively develop merchantable games.
What You Will Learn
Understand core C# concepts, such as class inheritance, interfaces, singletons, and static objects
Implement effective Artificial Intelligence for NPCs
Work with event-driven programming to optimize your code
Develop solid debugging and diagnostic techniques
Get to know the Mono Framework and Linq in practical contexts
Customize the rendering functionality for postprocess effects
Code line of sight, view testing, and other useful algorithms
Improve the quality of your code with the help of concepts such as attributes
Table of contents
-
Mastering Unity Scripting
- Table of Contents
- Mastering Unity Scripting
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Unity C# Refresher
- Why C#?
- Creating script files
- Instantiating scripts
- Variables
- Conditional statements
- Arrays
- Loops
- Functions
- Events
- Classes and object-oriented programming
- Classes and inheritance
- Classes and polymorphism
- C# properties
- Commenting
- Variable visibility
- The ? operator
- SendMessage and BroadcastMessage
- Summary
-
2. Debugging
- Compilation errors and the console
- Debugging with Debug.Log – custom messages
- Overriding the ToString method
- Visual debugging
- Error logging
- Editor debugging
- Using the profiler
- Debugging with MonoDevelop – getting started
- Debugging with MonoDevelop – the Watch window
- Debugging with MonoDevelop – continue and stepping
- Debugging with MonoDevelop – call stack
- Debugging with MonoDevelop – the Immediate window
- Debugging with MonoDevelop – conditional breakpoints
- Debugging with MonoDevelop – tracepoints
- Summary
- 3. Singletons, Statics, GameObjects, and the World
- 4. Event-driven Programming
- 5. Cameras, Rendering, and Scenes
- 6. Working with Mono
-
7. Artificial Intelligence
- Artificial Intelligence in games
- Starting the project
- Baking a navigation mesh
- Starting an NPC agent
- Finite State Machines in Mecanim
- Finite State Machines in C# – getting started
- Creating the Idle state
- Creating the Patrol state
- Creating the Chase state
- Creating the Attack state
- Creating the Seek-Health (or flee) state
- Summary
- 8. Customizing the Unity Editor
- 9. Working with Textures, Models, and 2D
- 10. Source Control and Other Tips
- Index
Product information
- Title: Mastering Unity Scripting
- Author(s):
- Release date: January 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784390655
You might also like
book
Unity 4 Fundamentals
Get ahead of the game with Unity 4. The Unity engine is the tool of choice …
book
Beginning Unity Editor Scripting: Create and Publish Your Game Tools
Learn about editor scripting in Unity, including different possible methods of editor customization to fit your …
book
Unity Networking Fundamentals: Creating Multiplayer Games with Unity
Learn the fundamentals of networking with Unity and C#. This book covers a variety of topics, …
book
Unity 5.x Cookbook
Over 100 recipes exploring the new and exciting features of Unity 5 to spice up your …