Being part of the wild frontier is amazing. It doesn’t take much to blow minds of first time mixed reality users — merely placing a canned hologram in the room is enough. However, once that childlike wonder fades, we need to add more substance to create lasting impressions.
One way to do this is through a primed, polished, and buffed user interface, but that’s expensive. So this tutorial will be the equivalent of giving your HoloLens UI a carwash. It’s a cheap investment but can still turn heads when it’s done.
We will be using coroutines to add slick but simple effects to our holograms when they are gazed upon. Coroutines allow partial work to be done in a frame and execution to be paused and then picked back up where left off in the following frame.
In one of our examples, we will be changing an object’s color over time. Calling a regular function containing a loop to attempt a smooth transition from Color A to Color B would result in the entire loop completing in one frame. This change would appear to happen immediately. Thus, using a coroutine here is a great choice as it can break up its execution over many frames to apply a gradual change.
We could also use the Update function to achieve this, but with scheduled events, using coroutines is generally the preferred method.
In today’s video, you’ll see a demonstration of what we will be building. There are also some fun bonus examples at the end created just by making small modifications to our scripts and adding a touch of creativity to our scene.
,
Source: Next Reality