Skip to content

Commit db72f4d

Browse files
committed
Playground update to v1.1 of GVR Unity SDK
1 parent 55f2dd6 commit db72f4d

File tree

1,454 files changed

+263129
-64325
lines changed

Some content is hidden

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

1,454 files changed

+263129
-64325
lines changed

Samples/DaydreamLabsControllerPlayground/Assets/Editor.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples/DaydreamLabsControllerPlayground/Assets/GoogleVR.meta

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples/DaydreamLabsControllerPlayground/Assets/GoogleVR/Demos.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples/DaydreamLabsControllerPlayground/Assets/GoogleVR/Demos/Editor.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright 2016 Google Inc. All rights reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using UnityEngine;
16+
using UnityEditor;
17+
18+
[CustomEditor(typeof(DemoInputManager))]
19+
public class DemoInputManagerEditor : Editor {
20+
#if UNITY_HAS_GOOGLEVR && UNITY_ANDROID
21+
SerializedProperty emulatedPlatformTypeProp;
22+
SerializedProperty gvrControllerMainProp;
23+
SerializedProperty gvrControllerPointerProp;
24+
SerializedProperty gvrReticlePointerProp;
25+
26+
void OnEnable () {
27+
gvrControllerMainProp =
28+
serializedObject.FindProperty(DemoInputManager.CONTROLLER_MAIN_PROP_NAME);
29+
gvrControllerPointerProp =
30+
serializedObject.FindProperty(DemoInputManager.CONTROLLER_POINTER_PROP_NAME);
31+
gvrReticlePointerProp =
32+
serializedObject.FindProperty(DemoInputManager.RETICLE_POINTER_PROP_NAME);
33+
34+
emulatedPlatformTypeProp =
35+
serializedObject.FindProperty(DemoInputManager.EMULATED_PLATFORM_PROP_NAME);
36+
}
37+
38+
public override void OnInspectorGUI() {
39+
// Platform emulation tweaking does not apply on non-native integration versions of Unity.
40+
serializedObject.Update();
41+
42+
EditorGUILayout.PropertyField(gvrControllerMainProp);
43+
EditorGUILayout.PropertyField(gvrControllerPointerProp);
44+
EditorGUILayout.PropertyField(gvrReticlePointerProp);
45+
46+
if (DemoInputManager.playerSettingsHasCardboard() ==
47+
DemoInputManager.playerSettingsHasDaydream()) {
48+
// Show the platform emulation dropdown only if both or neither VR SDK selected in
49+
// Player Settings > Virtual Reality supported,
50+
EditorGUILayout.PropertyField(emulatedPlatformTypeProp);
51+
}
52+
53+
serializedObject.ApplyModifiedProperties();
54+
}
55+
#endif // UNITY_HAS_GOOGLEVR && UNITY_ANDROID
56+
}

Samples/DaydreamLabsControllerPlayground/Assets/GoogleVR/Demos/Editor/DemoInputManagerEditor.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples/DaydreamLabsControllerPlayground/Assets/GoogleVR/Demos/Environment.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Copyright 2016 Google Inc. All rights reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
Shader "GoogleVR/Demos/Unlit/Env Unlit Grayscale" {
16+
Properties {
17+
_MainTex ("Texture (A)", 2D) = "" {}
18+
}
19+
20+
SubShader {
21+
Tags { "Queue"="Geometry" "RenderType"="Geometry"}
22+
23+
Pass {
24+
CGPROGRAM
25+
#pragma vertex vert
26+
#pragma fragment frag
27+
#pragma target 2.0
28+
#include "UnityCG.cginc"
29+
30+
#include "../../Shaders/GvrUnityCompatibility.cginc"
31+
32+
struct appdata {
33+
float4 vertex : POSITION;
34+
float2 uv : TEXCOORD0;
35+
};
36+
37+
struct v2f {
38+
float2 uv : TEXCOORD0;
39+
float4 vertex : SV_POSITION;
40+
};
41+
42+
sampler2D _MainTex;
43+
float4 _MainTex_ST;
44+
45+
v2f vert (appdata v) {
46+
v2f o;
47+
o.vertex = GvrUnityObjectToClipPos(v.vertex);
48+
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
49+
return o;
50+
}
51+
52+
fixed4 frag (v2f i) : SV_TARGET {
53+
fixed4 col = tex2D(_MainTex, i.uv).a;
54+
return col;
55+
}
56+
ENDCG
57+
}
58+
}
59+
}

Samples/DaydreamLabsControllerPlayground/Assets/GoogleVR/Demos/Environment/DemoEnvUnlitGrayscale.shader.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples/DaydreamLabsControllerPlayground/Assets/GoogleVR/Demos/Environment/Materials.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)