Unity Android Game Development by Example Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Chapter 3. The Backbone of Any Game – Meshes, Materials, and Animations

In the previous chapter we learned about the GUI. We started by creating a simple Tic-tac-toe game to learn about the basic pieces. This was followed by styling the GUI to change the look of the game. Finally, we adjusted the game so it would expand automatically to fit a screen of any size.

This chapter is about the core of any game: meshes, materials, and animations. Without these blocks there is generally nothing to show players. You could, of course, just use flat images in the GUI. But, where is the fun in that? If you are going to choose a 3D game engine, you might as well make full use of its capabilities.

To understand meshes, materials, and animations, we will be creating a Tank Battle game. This project will be used in a few other chapters. By the end of the book, it will be one of the two robust games we will create. For this chapter, the player will get to drive a tank around a small city, he/she will be able to shoot at animated targets, and we will add a counter to track the scores.

This chapter covers the following topics:

  • Importing the meshes
  • Creating the materials
  • Animations
  • Creating the prefabs
  • Ray tracing

We will be starting a new project for this chapter, so follow along in the first section to get it started.