Log in or register to post comments

Change Eyewear Type from code

June 16, 2017 - 7:43am #1

Hello everyone. 

My application currently uses a Video See-Through Eyewear Type with a generic cardboard.

However I would like it to be able to switch to normal mode when needed, because not everyone owns a cardboard at my school.

My question is, how can I change the Eyewear Type from inside the code ? I have a simple button that would switch the modes when pressed.

I tried checking the documentations but I can't figure it out. I know the DigitaleEyewearArController has a SetEyewearType method but how would I access it ? Do I have to create a new instance ? How would I bind it to my scene ?

This might look like a basic thing but I just started developing with Vuforia and I got stuck here. Any help is much apreciated.

Thanks in advance. Cheers !

Change Eyewear Type from code

June 23, 2017 - 11:06am #3

Hello jayceBolt,

This thread might be of assistance in what you're attempting to do: https://developer.vuforia.com/forum/unity/change-vuforia-configuration-script

Thanks.

Change Eyewear Type from code

June 16, 2017 - 10:14am #2

Update.

So far I managed to change the configuration before starting the application starts using InitalizeOnLoad

[InitializeOnLoad]

public class modeSwap : MonoBehaviour {

    static modeSwap()

    {

        DigitalEyewearARController.Instance.SetEyewearType(DigitalEyewearARController.EyewearType.None);

    }

I tried to call this script from the button's EventHandler but it doesnt make any action. The function gets called, but the camera mode remains the same.

Is it possible to do this while running the application ?

Log in or register to post comments