O'Reilly logo

Unity 5.x Game Development Blueprints by John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recording and displaying clicks

Now that we have this foundational button working, let's add some text to display information to the player.

  1. Go to GameObject | UI |Text. From there, use the Anchor Presets tool, hold down Alt + Shift, and click on the top-center option. It may be hard to see, so let's fix that up next. Change the Width to 1920 and Height to 100. You will remember that 1920 is what we used in our Reference Resolution, so this will take up the entire size.
  2. Then, change the Font Size to 75 and then change the Paragraph Alignment to be centered horizontally, change the Text Color to white, change the Text to You have: $0, and rename the Text object to CashText:
  3. Now select the CashText object and duplicate it (Ctrl+D) and give it a name ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required