android - Load different viewer profiles from script -
google cardboard sdk allows load vr viewer profile unity app scanning qr code in settings. have different qr codes different vr headsets , i'd load them script users can choose device menu without having search right qr code on internet , scan it.
i tried scan , set custom vr viewer profile works expected. tried save profile on sdcard serialising cardboardprofile object cardboard class this:
serialize (file,cardboard.device.profile);
and tried load custom profile @ cardboard initialisation. set profile variable custom profile in initdevice() function in cardboard class:
device = basevrdevice.getdevice(); device.profile = getcomponent<profilereader>().load (); device.init();
where getcomponent<profilereader>().load ()
returns custom deserialised cardboardprofile form resources folder (where copy file serialised object sdcard). set needed variables public , tweaked setters have access them. (de)serialise steps work fine. cardboardprofile c# object valid , double checked values. distortion , viewport won't change. still set default viewer profile.
any idea of how can change these vr viewer profile script?
thanks
alright, found it. who'd change vr viewer profile script, have vrdevice.cs
file , updateview()
, updateprofile()
functions. load 2 float arrays through getviewparameters(viewdata)
, getprofile(profiledata)
calls. these arrays (viewdata , profiledata) can saved, serialised , loaded. make sure updatescreendata()
called apply changes.
Comments
Post a Comment