O'Reilly logo

HoloLens Beginner’s Guide by Jason Odom

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

Where to begin

When we write a standard C# program, we would use the Main() function as our starting point. In Unity, we use the Start() and Update() functions as our main sources of flow control; these functions are part of the MonoBehaviour class.

MonoBehaviour is the base class of all Unity scripting. All classes derived from MonoBehaviour are required to be attached to a GameObject to run. MonoBehaviour also has a set of events or functions each script responds to.

We have touched on some of these events in previous chapters:

  • Start: This is called on the frame when a script is enabled, often used for setup.
  • Update: This is a method that is called every frame.
  • OnMouseDown: This is a method that is called when the user clicks the mouse ...

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