Android Cardboard

Is it possible to focus and open information in the same way as we do when we click on a magnet in a cardboard android? As a ray look in unity, is there an alternative for the android? I want to do something like what is shown in chromeexperiments

+4
source share
3 answers

Finally decided!

In the treasurehunt example, you can find a method isLookingAtObject()that determines where the user is looking for ...

And another method called onNewFramethat performs some action in each frame ...

My solution for our problem:

in onNewFrame method :

if (isLookingAtObject()) {
        selecting++; // selecting is an integer defined as a field with zero value!
    } else {
        selecting = 0;
    }
    if (selecting == 100) {
        startYourFunction(); // edit it on your own
        selecting = 0;
    }
}

, 100 , , , 100, reset .

, .

+1

, . ( ( ) , )

  • GazeInputModule.cs GoogleSamples - . : script Unity BaseInputModule , Canvas (_uGUI_) , . raycast .
  • , , Google Cardboard Unity
  • , Google-, Github
0

Source: https://habr.com/ru/post/1609420/


All Articles