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

Opening/closing the shop

Now, let's make it so we can open up the shop. With this in mind, let's create a button to do just that:

  1. Right-click on the Canvasobject, select GameObject | UI | Button and then rename the object to ShopOpenButton. Change the Width to 300 and Height to 60. From there, extend the Text object by selecting it and then from the Inspector tab under the Text component, change the Text to Open Shop and change the Font Size to 40.
  2. Now from the Hierarchy tab, select the ShopOpenButton object once again and then from the Anchor Presets window, hold down Alt and Shift and then click on top-left. Then, change Pos X to 20 and Pos Y to -20. Scroll down to the Button component, and from the On Click () section, click on the + button. ...

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