O'Reilly logo

Mastering Leap Motion by Brandon Sanders

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

Rendering buttons and detecting button presses

Now that you've got some hands on the screen, let's give those hands something to manipulate; to me, buttons would seem to be the next logical step. Don't you agree?

Get ready to write lots of code (six files, to be exact), because touchable buttons are no laughing matter in a 3D toolkit (well, they aren't so bad, but still). Head on over to the Scripts folder and double-click on the BaseSingleton.cs file; this should open up MonoDevelop if it wasn't already open to begin with.

BaseSingleton – a custom singleton pattern

Our first class, as the name suggests, is a custom implementation of the singleton pattern. What's a singleton, you ask? Read on!

In every program—and consequently, every game—you need ...

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