Skip to content
This repository was archived by the owner on Nov 8, 2019. It is now read-only.

Commit 04a79a1

Browse files
committed
GVR SDK for Unity v1.190.0
1 parent 8f0cdb5 commit 04a79a1

File tree

170 files changed

+2609
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+2609
-833
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
Summary:
1+
<!-- Use this issue tracker to file bugs and feature requests
2+
related to the Google VR SDK for Unity.
23
4+
For advice and general questions, please use the `google-cardboard` and
5+
`daydream` tags on Stack Overflow:
6+
- https://stackoverflow.com/questions/tagged/google-cardboard
7+
- https://stackoverflow.com/questions/tagged/daydream
8+
-->
39

4-
Found using:
5-
* Google VR SDK version:
6-
* Unity version:
7-
* Phone manufacturer, model, and O/S version:
8-
* Viewer manufacturer & model:
910

10-
Steps to reproduce the issue:
11+
### SPECIFIC ISSUE ENCOUNTERED
12+
13+
14+
### HARDWARE/SOFTWARE VERSIONS
15+
- Unity:
16+
- Google VR SDK for Unity:
17+
- Device manufacturer, model, and O/S:
18+
- Device fingerprint:
19+
Use `adb shell getprop ro.build.fingerprint`
20+
- Device display metrics:
21+
Output of `adb shell dumpsys display | grep mBaseDisplayInfo`
22+
- Google VR Services:
23+
On Windows, use: `adb shell pm dump com.google.vr.vrcore | findstr /i "packages: versionName"`
24+
On macOS, use: `adb shell pm dump com.google.vr.vrcore | egrep -i versionName\|packages:`
25+
- Viewer manufacturer & model:
26+
- Link to Unity project that reproduces the issue:
27+
28+
29+
### STEPS TO REPRODUCE THE ISSUE
1130
1.
1231
1.
1332
1.
1433

15-
Workarounds:
16-
34+
### WORKAROUNDS (IF ANY)
1735

18-
Additional comments:
1936

37+
### ADDITIONAL COMMENTS

Assets/GoogleVR/Beta/Demos/Hello6DoFControllers/Scripts/DemoObjectController6DoF.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="DemoObjectController6DoF.cs" company="Google Inc.">
13
// Copyright 2018 Google Inc. All rights reserved.
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +13,8 @@
1113
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
// See the License for the specific language governing permissions and
1315
// limitations under the License.
16+
// </copyright>
17+
//-----------------------------------------------------------------------
1418

1519
namespace GoogleVR.Hello6DoFController
1620
{

Assets/GoogleVR/Beta/Scripts/GvrBeta.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="GvrBeta.cs" company="Google Inc.">
13
// Copyright 2018 Google Inc. All rights reserved.
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +13,8 @@
1113
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
// See the License for the specific language governing permissions and
1315
// limitations under the License.
16+
// </copyright>
17+
//-----------------------------------------------------------------------
1418

1519
/// Daydream Beta API. This API surface is for experimental purposes and may
1620
/// change or be removed in any future release without forewarning.

Assets/GoogleVR/Beta/Scripts/GvrBetaControllerVisualMulti.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="GvrBetaControllerVisualMulti.cs" company="Google Inc.">
13
// Copyright 2018 Google Inc. All rights reserved.
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +13,8 @@
1113
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
// See the License for the specific language governing permissions and
1315
// limitations under the License.
16+
// </copyright>
17+
//-----------------------------------------------------------------------
1418

1519
namespace GoogleVR.Beta
1620
{
@@ -49,7 +53,7 @@ protected override VisualAssets GetVisualAssets()
4953

5054
int controllerVisualIndex = 0;
5155
if (ControllerInputDevice != null &&
52-
ControllerInputDevice.GetConfigurationType() ==
56+
ControllerInputDevice.GetConfigurationType() ==
5357
GvrBetaControllerInput.Configuration.Is6DoF)
5458
{
5559
controllerVisualIndex = 1;

Assets/GoogleVR/Demos/Editor/DemoInputManagerEditor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="DemoInputManagerEditor.cs" company="Google Inc.">
13
// Copyright 2016 Google Inc. All rights reserved.
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +13,8 @@
1113
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
// See the License for the specific language governing permissions and
1315
// limitations under the License.
16+
// </copyright>
17+
//-----------------------------------------------------------------------
1418

1519
namespace GoogleVR.Demos
1620
{

Assets/GoogleVR/Demos/Editor/PermissionsDemoBuildProcessor.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1+
//-----------------------------------------------------------------------
12
// <copyright file="PermissionsDemoBuildProcessor.cs" company="Google Inc.">
2-
// Copyright (C) 2016 Google Inc. All Rights Reserved.
3+
// Copyright 2017 Google Inc. All rights reserved.
34
//
4-
// Licensed under the Apache License, Version 2.0 (the "License");
5-
// you may not use this file except in compliance with the License.
6-
// You may obtain a copy of the License at
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
78
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
9+
// http://www.apache.org/licenses/LICENSE-2.0
910
//
10-
// Unless required by applicable law or agreed to in writing, software
11-
// distributed under the License is distributed on an "AS IS" BASIS,
12-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
// See the License for the specific language governing permissions and
14-
// limitations under the License.
15-
//
16-
// Only invoke custom build processor when building for Android.
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
1716
// </copyright>
17+
//-----------------------------------------------------------------------
18+
19+
// Only invoke custom build processor when building for Android.
1820
#if UNITY_ANDROID
1921
namespace GoogleVR.Demos
2022
{

Assets/GoogleVR/Demos/Scenes/KeyboardDemo.unity

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,10 @@ Prefab:
13071307
propertyPath: m_RootOrder
13081308
value: 0
13091309
objectReference: {fileID: 0}
1310+
- target: {fileID: 11499020, guid: 8524bbe5e592a42dc9251484a73c9c7f, type: 2}
1311+
propertyPath: controllerPointers.Array.data[0]
1312+
value:
1313+
objectReference: {fileID: 328517437}
13101314
m_RemovedComponents: []
13111315
m_ParentPrefab: {fileID: 100100000, guid: 8524bbe5e592a42dc9251484a73c9c7f, type: 2}
13121316
m_IsPrefabParent: 0

Assets/GoogleVR/Demos/Scenes/VideoDemo.unity

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0.4465934, g: 0.49642956, b: 0.5748249, a: 1}
41+
m_IndirectSpecularColor: {r: 0.4465934, g: 0.49642956, b: 0.57482487, a: 1}
4242
--- !u!157 &3
4343
LightmapSettings:
4444
m_ObjectHideFlags: 0
@@ -622,6 +622,10 @@ Prefab:
622622
propertyPath: m_LocalPosition.z
623623
value: 4
624624
objectReference: {fileID: 0}
625+
- target: {fileID: 11499020, guid: 8524bbe5e592a42dc9251484a73c9c7f, type: 2}
626+
propertyPath: controllerPointers.Array.data[0]
627+
value:
628+
objectReference: {fileID: 817331498}
625629
m_RemovedComponents: []
626630
m_ParentPrefab: {fileID: 100100000, guid: 8524bbe5e592a42dc9251484a73c9c7f, type: 2}
627631
m_IsPrefabParent: 0

Assets/GoogleVR/Demos/Scripts/DemoInputManager.cs

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="DemoInputManager.cs" company="Google Inc.">
13
// Copyright 2017 Google Inc. All rights reserved.
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +13,8 @@
1113
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
// See the License for the specific language governing permissions and
1315
// limitations under the License.
16+
// </copyright>
17+
//-----------------------------------------------------------------------
1418

1519
#if UNITY_ANDROID && !UNITY_EDITOR
1620
#define RUNNING_ON_ANDROID_DEVICE
@@ -24,7 +28,6 @@ namespace GoogleVR.Demos
2428

2529
#if UNITY_2017_2_OR_NEWER
2630
using UnityEngine.XR;
27-
2831
#else
2932
using XRSettings = UnityEngine.VR.VRSettings;
3033
#endif // UNITY_2017_2_OR_NEWER
@@ -34,17 +37,17 @@ public class DemoInputManager : MonoBehaviour
3437
private const string MESSAGE_CANVAS_NAME = "MessageCanvas";
3538
private const string MESSAGE_TEXT_NAME = "MessageText";
3639
private const string LASER_GAMEOBJECT_NAME = "Laser";
37-
private const string CONTROLLER_CONNECTING_MESSAGE = "Controller connecting...";
38-
private const string CONTROLLER_DISCONNECTED_MESSAGE = "Controller disconnected";
39-
private const string CONTROLLER_SCANNING_MESSAGE = "Controller scanning...";
40+
private const string CONTROLLER_CONNECTING_MESSAGE = "Daydream controller connecting...";
41+
private const string CONTROLLER_DISCONNECTED_MESSAGE = "Daydream controller not connected";
42+
private const string CONTROLLER_SCANNING_MESSAGE = "Scanning for Daydream controller...";
4043
private const string NON_GVR_PLATFORM =
41-
"Please select a supported Google VR platform via 'Build Settings > Android | iOS > Switch Platform'\n";
44+
"Please select a supported Google VR platform via 'Build Settings > Android | iOS > Switch Platform'\n";
4245

4346
private const string VR_SUPPORT_NOT_CHECKED =
44-
"Please make sure 'Player Settings > Virtual Reality Supported' is checked\n";
47+
"Please make sure 'Player Settings > Virtual Reality Supported' is checked\n";
4548

4649
private const string EMPTY_VR_SDK_WARNING_MESSAGE =
47-
"Please add 'Daydream' or 'Cardboard' under 'Player Settings > Virtual Reality SDKs'\n";
50+
"Please add 'Daydream' or 'Cardboard' under 'Player Settings > Virtual Reality SDKs'\n";
4851

4952
// Java class, method, and field constants.
5053
private const int ANDROID_MIN_DAYDREAM_API = 24;
@@ -63,10 +66,10 @@ public class DemoInputManager : MonoBehaviour
6366

6467
// Buttons that can trigger pointer switching.
6568
private const GvrControllerButton pointerButtonMask =
66-
GvrControllerButton.App |
67-
GvrControllerButton.TouchPadButton |
68-
GvrControllerButton.Trigger |
69-
GvrControllerButton.Grip;
69+
GvrControllerButton.App |
70+
GvrControllerButton.TouchPadButton |
71+
GvrControllerButton.Trigger |
72+
GvrControllerButton.Grip;
7073

7174
[Tooltip("Reference to GvrControllerMain")]
7275
public GameObject controllerMain;
@@ -120,8 +123,8 @@ void Start()
120123
// The list is populated with valid VR SDK(s), pick the first one.
121124
gvrEmulatedPlatformType =
122125
(XRSettings.supportedDevices[0] == GvrSettings.VR_SDK_DAYDREAM) ?
123-
EmulatedPlatformType.Daydream :
124-
EmulatedPlatformType.Cardboard;
126+
EmulatedPlatformType.Daydream :
127+
EmulatedPlatformType.Cardboard;
125128
}
126129
isDaydream = (gvrEmulatedPlatformType == EmulatedPlatformType.Daydream);
127130
#else
@@ -134,17 +137,17 @@ void Start()
134137
if (vrDeviceName != GvrSettings.VR_SDK_CARDBOARD &&
135138
vrDeviceName != GvrSettings.VR_SDK_DAYDREAM)
136139
{
137-
Debug.LogErrorFormat("Loaded device was '{0}', must be one of '{1}' or '{2}'",
140+
Debug.LogErrorFormat("Loaded device was '{0}', must be one of '{1}' or '{2}'",
138141
vrDeviceName, GvrSettings.VR_SDK_DAYDREAM, GvrSettings.VR_SDK_CARDBOARD);
139-
return;
142+
return;
140143
}
141144

142145
// On a non-Daydream ready phone, fall back to Cardboard if it's present in the list of
143146
// enabled VR SDKs.
144147
// On a Daydream-ready phone, go into Cardboard mode if it's the currently-paired viewer.
145148
if ((!IsDeviceDaydreamReady() && playerSettingsHasCardboard()) ||
146-
(IsDeviceDaydreamReady() && playerSettingsHasCardboard() &&
147-
GvrSettings.ViewerPlatform == GvrSettings.ViewerPlatformType.Cardboard))
149+
(IsDeviceDaydreamReady() && playerSettingsHasCardboard() &&
150+
GvrSettings.ViewerPlatform == GvrSettings.ViewerPlatformType.Cardboard))
148151
{
149152
vrDeviceName = GvrSettings.VR_SDK_CARDBOARD;
150153
}
@@ -195,7 +198,7 @@ void Update()
195198
#if !RUNNING_ON_ANDROID_DEVICE
196199
UpdateEmulatedPlatformIfPlayerSettingsChanged();
197200
if ((isDaydream && gvrEmulatedPlatformType == EmulatedPlatformType.Daydream) ||
198-
(!isDaydream && gvrEmulatedPlatformType == EmulatedPlatformType.Cardboard))
201+
(!isDaydream && gvrEmulatedPlatformType == EmulatedPlatformType.Cardboard))
199202
{
200203
return;
201204
}
@@ -235,7 +238,7 @@ public static bool playerSettingsHasCardboard()
235238
element => element.Equals(GvrSettings.VR_SDK_CARDBOARD));
236239
}
237240

238-
#if !RUNNING_ON_ANDROID_DEVICE
241+
#if !RUNNING_ON_ANDROID_DEVICE
239242
private void UpdateEmulatedPlatformIfPlayerSettingsChanged()
240243
{
241244
if (!playerSettingsHasDaydream() && !playerSettingsHasCardboard())
@@ -246,51 +249,51 @@ private void UpdateEmulatedPlatformIfPlayerSettingsChanged()
246249
// Player Settings > VR SDK list may have changed at runtime. The emulated platform
247250
// may not have been manually updated if that's the case.
248251
if (gvrEmulatedPlatformType == EmulatedPlatformType.Daydream &&
249-
!playerSettingsHasDaydream())
252+
!playerSettingsHasDaydream())
250253
{
251254
gvrEmulatedPlatformType = EmulatedPlatformType.Cardboard;
252255
}
253256
else if (gvrEmulatedPlatformType == EmulatedPlatformType.Cardboard &&
254-
!playerSettingsHasCardboard())
257+
!playerSettingsHasCardboard())
255258
{
256259
gvrEmulatedPlatformType = EmulatedPlatformType.Daydream;
257260
}
258261
}
259-
#endif // !RUNNING_ON_ANDROID_DEVICE
262+
#endif // !RUNNING_ON_ANDROID_DEVICE
260263

261-
#if RUNNING_ON_ANDROID_DEVICE
262-
// Running on an Android device.
263-
private static bool IsDeviceDaydreamReady()
264-
{
265-
// Check API level.
266-
using (var version = new AndroidJavaClass(PACKAGE_BUILD_VERSION))
264+
#if RUNNING_ON_ANDROID_DEVICE
265+
// Running on an Android device.
266+
private static bool IsDeviceDaydreamReady()
267267
{
268-
if (version.GetStatic<int>(FIELD_SDK_INT) < ANDROID_MIN_DAYDREAM_API)
269-
{
268+
// Check API level.
269+
using (var version = new AndroidJavaClass(PACKAGE_BUILD_VERSION))
270+
{
271+
if (version.GetStatic<int>(FIELD_SDK_INT) < ANDROID_MIN_DAYDREAM_API)
272+
{
273+
return false;
274+
}
275+
}
276+
277+
// API level > 24, check whether the device is Daydream-ready..
278+
AndroidJavaObject androidActivity = null;
279+
try
280+
{
281+
androidActivity = GvrActivityHelper.GetActivity();
282+
}
283+
catch (AndroidJavaException e)
284+
{
285+
Debug.LogError("Exception while connecting to the Activity: " + e);
270286
return false;
271-
}
272-
}
273-
274-
// API level > 24, check whether the device is Daydream-ready..
275-
AndroidJavaObject androidActivity = null;
276-
try
277-
{
278-
androidActivity = GvrActivityHelper.GetActivity();
279-
}
280-
catch (AndroidJavaException e)
281-
{
282-
Debug.LogError("Exception while connecting to the Activity: " + e);
283-
return false;
284-
}
285-
286-
AndroidJavaClass daydreamApiClass = new AndroidJavaClass(PACKAGE_DAYDREAM_API_CLASS);
287-
if (daydreamApiClass == null || androidActivity == null)
288-
{
289-
return false;
290-
}
291-
292-
return daydreamApiClass.CallStatic<bool>(METHOD_IS_DAYDREAM_READY, androidActivity);
293-
}
287+
}
288+
289+
AndroidJavaClass daydreamApiClass = new AndroidJavaClass(PACKAGE_DAYDREAM_API_CLASS);
290+
if (daydreamApiClass == null || androidActivity == null)
291+
{
292+
return false;
293+
}
294+
295+
return daydreamApiClass.CallStatic<bool>(METHOD_IS_DAYDREAM_READY, androidActivity);
296+
}
294297
#endif // RUNNING_ON_ANDROID_DEVICE
295298

296299
private void UpdateStatusMessage()
@@ -329,7 +332,7 @@ private void UpdateStatusMessage()
329332
string vrSdkWarningMessage = isVrSdkListEmpty ? EMPTY_VR_SDK_WARNING_MESSAGE : "";
330333
string controllerMessage = "";
331334
GvrPointerGraphicRaycaster graphicRaycaster =
332-
messageCanvas.GetComponent<GvrPointerGraphicRaycaster>();
335+
messageCanvas.GetComponent<GvrPointerGraphicRaycaster>();
333336
GvrControllerInputDevice dominantDevice = GvrControllerInput.GetDevice(GvrControllerHand.Dominant);
334337
GvrConnectionState connectionState = dominantDevice.State;
335338

@@ -370,7 +373,7 @@ private void UpdateStatusMessage()
370373
messageCanvas.SetActive(isVrSdkListEmpty ||
371374
(connectionState != GvrConnectionState.Connected));
372375
#endif // !UNITY_ANDROID && !UNITY_IOS
373-
}
376+
}
374377

375378
private void SetVRInputMechanism()
376379
{

0 commit comments

Comments
 (0)