Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
Release 1.01 - Maintenance release
Browse files Browse the repository at this point in the history
      * Updated to use GVR Unity SDK v1.70.0
  • Loading branch information
dsternfeld7 committed Oct 2, 2017
1 parent 1c6d13e commit 146a140
Show file tree
Hide file tree
Showing 426 changed files with 10,216 additions and 16,924 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// Trigger that fires while controller app button is pressed down.
public class AppButtonClickTrigger : BaseActionTrigger {
public override bool TriggerActive() {
return GvrController.AppButton;
return GvrControllerInput.AppButton;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// Trigger that fires for 1 frame when trackpad button is pressed down.
public class TouchpadClickDownTrigger : BaseActionTrigger {
public override bool TriggerActive() {
return GvrController.ClickButtonDown;
return GvrControllerInput.ClickButtonDown;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// Trigger that fires while trackpad button is pressed down.
public class TouchpadClickTrigger : BaseActionTrigger {
public override bool TriggerActive() {
return GvrController.ClickButton;
return GvrControllerInput.ClickButton;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// Trigger that fires for 1 frame when trackpad button is released.
public class TouchpadClickUpTrigger : BaseActionTrigger {
public override bool TriggerActive() {
return GvrController.ClickButtonUp;
return GvrControllerInput.ClickButtonUp;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public enum Side {
private float sideWidth = .2f;

public override bool TriggerActive() {
if (GvrController.IsTouching == false ||
GvrController.ClickButtonDown == false) {
if (GvrControllerInput.IsTouching == false ||
GvrControllerInput.ClickButtonDown == false) {
return false;
}

float xPos = GvrController.TouchPos.x;
float xPos = GvrControllerInput.TouchPos.x;

// Check for left side active.
if (xPos <= sideWidth) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public enum Side {
private float sideWidth = .2f;

public override bool TriggerActive() {
if (GvrController.IsTouching == false) {
if (GvrControllerInput.IsTouching == false) {
return false;
}

float xPos = GvrController.TouchPos.x;
float xPos = GvrControllerInput.TouchPos.x;

// Check for left side active.
if (xPos <= sideWidth) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// Trigger that fires if users finger is touching the touchpad.
public class TouchpadTouchDownTrigger : BaseActionTrigger {
public override bool TriggerActive() {
return GvrController.TouchDown;
return GvrControllerInput.TouchDown;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// Trigger that fires if users finger is not touching the touchpad.
public class TouchpadTouchUpTrigger : BaseActionTrigger {
public override bool TriggerActive() {
return GvrController.TouchUp;
return GvrControllerInput.TouchUp;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public class FirstPersonTunnelingLocomotion : MonoBehaviour {
}

protected virtual void Update() {
if (GvrController.TouchDown) {
initTouch = GvrController.TouchPos;
if (GvrControllerInput.TouchDown) {
initTouch = GvrControllerInput.TouchPos;
} else if (CanStartMoving()) {
isMoving = true;
smoothTouch = Vector2.zero;
vignetteController.ShowVignette();
} else if (GvrController.TouchUp) {
} else if (GvrControllerInput.TouchUp) {
StopMoving();
}

Expand Down Expand Up @@ -188,7 +188,7 @@ public class FirstPersonTunnelingLocomotion : MonoBehaviour {
}

private bool CanStartMoving() {
if (!GvrController.IsTouching) {
if (!GvrControllerInput.IsTouching) {
return false;
}

Expand All @@ -200,7 +200,7 @@ public class FirstPersonTunnelingLocomotion : MonoBehaviour {
return false;
}

bool isOutsideSlop = IsTouchOutsideSlop(GvrController.TouchPos);
bool isOutsideSlop = IsTouchOutsideSlop(GvrControllerInput.TouchPos);
bool needsSwipe = onlyMoveAfterSwiping && !isOutsideSlop;


Expand All @@ -221,11 +221,11 @@ public class FirstPersonTunnelingLocomotion : MonoBehaviour {
}

private Vector2 TouchPosBetweenNegativeOneToOne() {
// GvrController.TouchPos gives you values between 0.0 and 1.0, with 0.5 being the middle of the touch pad.
// GvrControllerInput.TouchPos gives you values between 0.0 and 1.0, with 0.5 being the middle of the touch pad.
// We must convert this to a range of -1.0 to 1.0 with 0.0 in the middle.
Vector2 result;
result.x = (GvrController.TouchPos.x * 2.0f) - 1.0f;
result.y = ((GvrController.TouchPos.y * 2.0f) - 1.0f) * -1.0f;
result.x = (GvrControllerInput.TouchPos.x * 2.0f) - 1.0f;
result.y = ((GvrControllerInput.TouchPos.y * 2.0f) - 1.0f) * -1.0f;
result.x = Mathf.Clamp(result.x, -1.0f, 1.0f);
result.y = Mathf.Clamp(result.y, -1.0f, 1.0f);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Shader "GoogleVR/Tunneling/VignetteCage" {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Assets/GoogleVR/Shaders/GvrUnityCompatibility.cginc"


struct appdata {
float4 vertex : POSITION;
Expand Down
4 changes: 4 additions & 0 deletions Assets/GoogleVR.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/GoogleVR/Demos.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/GoogleVR/Demos/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Assets/GoogleVR/Demos/Editor/DemoInputManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

[CustomEditor(typeof(DemoInputManager))]
public class DemoInputManagerEditor : Editor {
#if UNITY_HAS_GOOGLEVR && UNITY_ANDROID
SerializedProperty emulatedPlatformTypeProp;
SerializedProperty gvrControllerMainProp;
SerializedProperty gvrControllerPointerProp;
Expand All @@ -36,7 +35,6 @@ public class DemoInputManagerEditor : Editor {
}

public override void OnInspectorGUI() {
// Platform emulation tweaking does not apply on non-native integration versions of Unity.
serializedObject.Update();

EditorGUILayout.PropertyField(gvrControllerMainProp);
Expand All @@ -52,5 +50,4 @@ public class DemoInputManagerEditor : Editor {

serializedObject.ApplyModifiedProperties();
}
#endif // UNITY_HAS_GOOGLEVR && UNITY_ANDROID
}
3 changes: 1 addition & 2 deletions Assets/GoogleVR/Demos/Editor/PermissionsDemoBuildEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

// This script only works in Unity 5.6 or newer since older versions of Unity
// don't have IPreprocessBuild and IPostprocessBuild.

#if UNITY_5_6_OR_NEWER && UNITY_ANDROID
using System;
using UnityEditor;
Expand Down Expand Up @@ -137,4 +136,4 @@ public void OnPostprocessBuild(BuildTarget target, string path)
m_cardboardAddedFromCode = false;
}
}
#endif // UNITY_5_6_OR_NEWER
#endif // UNITY_5_6_OR_NEWER && UNITY_ANDROID
2 changes: 1 addition & 1 deletion Assets/GoogleVR/Demos/Environment.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ Shader "GoogleVR/Demos/Unlit/Env Unlit Grayscale" {
#pragma target 2.0
#include "UnityCG.cginc"

#include "../../Shaders/GvrUnityCompatibility.cginc"

struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
Expand All @@ -44,7 +42,7 @@ Shader "GoogleVR/Demos/Unlit/Env Unlit Grayscale" {

v2f vert (appdata v) {
v2f o;
o.vertex = GvrUnityObjectToClipPos(v.vertex);
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/GoogleVR/Demos/Environment/Materials.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 146a140

Please sign in to comment.