Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Gamification with Unity 5.x

You're reading from  Gamification with Unity 5.x

Product type Book
Published in Nov 2016
Publisher Packt
ISBN-13 9781786463487
Pages 328 pages
Edition 1st Edition
Languages
Concepts

Table of Contents (16) Chapters

Gamification with Unity 5.x
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. The Anatomy of Games 2. Who or What Am I? Understanding the Player 3. An Engaged Player is a Happy Player 4. Organized Chaos - Getting Ideas Out of Your Head and on to Paper 5. Sculpting the Conceptual Beast 6. Breathing Life into Your First Creation - Creating and Importing Assets for Your Application 7. Get Your Motor Running 8. Break, Destroy, and Rebuild - the Art of Playtesting and Iteration 9. Graduating Your Project to Completion 10. Being the Best That You Can Be!

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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}