Book Image

Gamification with Unity 5.x

Book Image

Gamification with Unity 5.x

Overview of this book

Are you looking at implementing gamification techniques for your business and wondering where to get a complete rundown of all the tricks and techniques? Well, you have come to the right place! This book will start right from the basics such as gameplay elements and their functionalities before gradually moving onto creating your first gamification project from scratch. You’ll be given the tools and shown how to perform various techniques for creating gamified applications in different contexts. Finally, you will implement various game elements into Unity, publish your own task management application, and get to know the best practices and approaches when designing gamified experiences.
Table of Contents (16 chapters)
Gamification with Unity 5.x
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

On point!


Points can come in various ways. A player can obtain points by defeating an enemy, doing the right thing, or even working cooperatively with other players. Now we have worked on a lot of images, this section shows us how to use the text component to implement a Point System.

Let's start by creating a text component. To do this, right-click on the Hierarchy panel and then select UI | Text. We can rename it Point System. Feel free to customize it as you want by changing the font, size, and so on. It doesn't matter what text you put in it, because it will be replaced by our script, but we can use anything as a placeholder. In this case, we can write Points: 100. Once we have done all of this, we should have something that looks the following screenshot, in the Scene view:

The points system in Unity

Now, let's add a script and name it PointSystemScript. Since we are going to use UI components, let's import the library by adding the following line at the beginning of our script:

using...