This repository was archived by the owner on Nov 8, 2019. It is now read-only.
GVR SDK for Unity v1.150.0
Multiple controller support
- New
GvrControllerInputDeviceclass for accessing controllers, accessible viaGvrControllerInput.GetDevice(GvrControllerHand hand). - New
GvrControllerInput.OnDevicesChangedevent to handle changes inGvrControllerInputDeviceinstances. Old instances will be marked invalid and error when used. When this event fires, re-fetch the desiredGvrControllerInputDevicefromGvrControllerInput.GetDevice(). New handlers added to this event will be called immediately upon adding. - New
GvrControllerHandenum for specifying handedness.- Values:
Right,Left,Dominant,NonDominant. Dominantcontroller will always be present on single and multiple controller systems and will map to theRightorLeftcontroller depending on the handedness system prefrerence setting (GvrSettings.Handedness).
- Values:
- New
GvrControllerButtonenum for specifying controller buttons. Values can be OR'ed together to create a multi-button mask. - New
GvrTrackedController.ControllerHandproperty to specify which handGvrTrackedControllertracks. - New
IGvrControllerInputDeviceReceiverinterface. Script components that that implement this receiver interface and are children ofGvrTrackedControlleror children of the object set inGvrTrackedController.ArmModelwill receive callbacks when the tracked controller initializes or changes its device instance. - GvrControllerPointer prefab defaults to
Dominantcontroller.- The prefab will automatically track the Daydream controller on devices that only support one controller.
- To develop for devices that support two controllers, add a second prefab instance to your scene and change the hand property to
NonDominant.
- HelloVR scene now has two
GvrControllerPointergame objects forDominantandNonDominanthands.- On devices that only support a single controller, only the
Dominantcontroller will be activated at runtime.
- On devices that only support a single controller, only the
- DemoSceneManager prefab updated for 2 controllers.
DemoInputManager'sControllerPointersproperty is now an array to handle multiple controllers. Since there can only be one pointer at a time,DemoInputManageractivates the single pointer on the last controller the user clicked theApporTouchPadButtonbutton.- Generally, when upgrading from obsolete
GvrControllerInputmethods toGvrControllerInputDevicemethods, you will need to consider how best to getGvrControllerInputDeviceinstance updates. If your component will be a child ofGvrTrackedController, then your component should implement theIGvrControllerInputDeviceReceiverinterface to receive device instance updates fromGvrTrackedController. This has the advantage that your component will automatically get theGvrControllerInputDeviceof the hand for which the parentGvrTrackedControlleris configured. If your component lives outside ofGvrTrackedControlleryou can either fetch a device instance every time you need one fromGvrControllerInput.GetDevice(), or register an event hander forGvrControllerInput.OnDevicesChangedto receive callbacks when device instances change and cache the result of a call toGvrControllerInput.GetDevice().
Breaking changes
None.
Deprecations
- Most of the static
GvrControllerInputmethods and properties have been deprecated. Replacement methods and properties can be accessed on the newGvrControllerInputDeviceinstances:- The following static properties are available, with the same name, as
GvrControllerInputDeviceinstance properties:OnStateChangedStateOrientationGyroAccelErrorDetailsStatePtrIsChargingBatteryLevel
- The following static properties have been deprecated and are replaced by a single
TouchPosinstance property onGvrControllerInputDevicethat returns center relative touch coordinates:GvrControllerInput.TouchPosCentered(center is(0, 0)) ->TouchPos(center is(0, 0))GvrControllerInput.TouchPos(top-left is(0, 0)) ->TouchPosonGvrControllerInputDevice(center is(0, 0))
- The following static methods have been replaced by similarly named
GvrControllerInputDeviceinstance methods. Method names have been changed for consistency with Unity's Input API:GvrControllerInput.IsTouching()->GetButton(GvrControllerButton.TouchPadTouch)GvrControllerInput.TouchDown()->GetButtonDown(GvrControllerButton.TouchPadTouch)GvrControllerInput.TouchUp()->GetButtonUp(GvrControllerButton.TouchPadTouch)GvrControllerInput.ClickButton()->GetButton(GvrControllerButton.TouchPadButton)GvrControllerInput.ClickButtonDown()->GetButtonDown(GvrControllerButton.TouchPadButton)GvrControllerInput.ClickButtonUp()->GetButtonUp(GvrControllerButton.TouchPadButton)GvrControllerInput.AppButton()->GetButton(GvrControllerButton.App)GvrControllerInput.AppButtonDown()->GetButtonDown(GvrControllerButton.App)GvrControllerInput.AppButton()->GetButtonUp(GvrControllerButton.App)GvrControllerInput.HomeButtonDown()->GetButtonDown(GvrControllerButton.System)GvrControllerInput.HomeButtonState()->GetButton(GvrControllerButton.System)
- The following static properties are available, with the same name, as
Behavioral changes
HeadsetDemoManagerdebug logging of safety region and floor height is now off by default.
Other changes
- Added support for positionally tracked headsets in Instant Preview.
- Updated bundled lib GVR for Android to v1.150.0.
- Fixed IPreprocessBuild and IPostrocessBuild obsolete warnings in Unity 2018.x.
- Added null checks on
safetyRinginHeadsetDemoManager. - Added source code for native libs
gvr-exoplayersupport,gvr-keyboardsupport,gvr-permissionsupport, andvideo_pluginto the git repo. Addresses issues 437 and 556.
Experimental features
Bug fixes
- Fixed issue 822 where the permission request could result in a crash after the permission had been granted.
- Fixed issue 835. The
GvrEditorEmulatorwas previously allocating memory every frame, and should now only allocate onAwake(). - Fixed issue 865 where
GvrVRHelpers.GetHeadRotation()didn't work with Instant Preview. - Fixed issue 888. Added a console warning when trying to use a
GvrTrackedControllerwithout aGvrControllerInput. - Fixed issue 917 where using
GVRKeyboardwhen building with IL2CPP would throwNotSupportedException. - Fixed issue 918 where adding a new
GVRKeyboardcomponent after destroying one will cause a crash. - Fixed the pointer reticle not showing up properly on all of the demo scenes that use the CubeRoom prefab.
- Fixed missing Instant Preview newlines characters in standard output and standard error console messages.