Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#167) Remove Unity 2019 errors for Leap V2 Core Assets #168

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Assets/AssetStoreTools/Editor/AssetStoreTools.dll
Binary file not shown.
Binary file modified Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions Assets/LeapMotion/DemoResources/Scripts/RecordingControls.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class RecordingControls : MonoBehaviour {
[Multiline]
public string header;
public GUIText controlsGui;
public GUIText recordingGui;
public Text controlsGui;
public Text recordingGui;

public KeyCode beginRecordingKey = KeyCode.R;
public KeyCode endRecordingKey = KeyCode.R;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Toon/Basic" {
Properties {
_Color ("Main Color", Color) = (.5,.5,.5,1)
Expand Down Expand Up @@ -39,7 +41,7 @@ Shader "Toon/Basic" {
v2f vert (appdata v)
{
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.pos = UnityObjectToClipPos (v.vertex);
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
o.cubenormal = mul (UNITY_MATRIX_MV, float4(v.normal,0));
return o;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Toon/Basic Outline" {
Properties {
_Color ("Main Color", Color) = (.5,.5,.5,1)
Expand Down Expand Up @@ -25,7 +27,7 @@ Shader "Toon/Basic Outline" {

v2f vert(appdata v) {
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.pos = UnityObjectToClipPos(v.vertex);

float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal);
float2 offset = TransformViewToProjection(norm.xy);
Expand Down
Binary file modified Assets/LeapMotion/Prefabs/PluginLeapNotice.prefab
Binary file not shown.
4 changes: 3 additions & 1 deletion Assets/LeapMotion/Resources/ImageHandHighlight.shader
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "LeapMotion/Passthrough/ImageHandHighlight" {
Properties {
_Color ("Color", Color) = (0.165,0.337,0.578,1.0)
Expand Down Expand Up @@ -50,7 +52,7 @@ Shader "LeapMotion/Passthrough/ImageHandHighlight" {

frag_in vert(appdata v) {
frag_in o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
o.vertex = UnityObjectToClipPos(v.vertex);

float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal);
o.vertex.xy += TransformViewToProjection(norm.xy) * _Extrude;
Expand Down
6 changes: 4 additions & 2 deletions Assets/LeapMotion/Resources/PassthroughBackground.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Shader "LeapMotion/Passthrough/Background" {
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "LeapMotion/Passthrough/Background" {
SubShader {
Tags {"Queue"="Background" "IgnoreProjector"="True"}

Expand Down Expand Up @@ -26,7 +28,7 @@

frag_in vert(appdata_img v){
frag_in o;
o.position = mul(UNITY_MATRIX_MVP, v.vertex);
o.position = UnityObjectToClipPos(v.vertex);
o.screenPos = LeapGetWarpedScreenPos(o.position);
return o;
}
Expand Down
6 changes: 4 additions & 2 deletions Assets/LeapMotion/Resources/PassthroughForeground.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Shader "LeapMotion/Passthrough/Foreground" {
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "LeapMotion/Passthrough/Foreground" {
Properties {
}

Expand Down Expand Up @@ -29,7 +31,7 @@

frag_in vert(appdata_img v){
frag_in o;
o.position = mul(UNITY_MATRIX_MVP, v.vertex);
o.position = UnityObjectToClipPos(v.vertex);
o.screenPos = LeapGetWarpedScreenPos(o.position);
return o;
}
Expand Down
6 changes: 4 additions & 2 deletions Assets/LeapMotion/Resources/ThresholdOverlay.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Shader "LeapMotion/Passthrough/ThresholdOverlay" {
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "LeapMotion/Passthrough/ThresholdOverlay" {
Properties {
_Min ("Min Brightness", Range(0, 1)) = 0.1
_Max ("Max Brightness", Range(0, 1)) = 0.3
Expand Down Expand Up @@ -34,7 +36,7 @@

frag_in vert(appdata_img v){
frag_in o;
o.position = mul(UNITY_MATRIX_MVP, v.vertex);
o.position = UnityObjectToClipPos(v.vertex);
o.screenPos = LeapGetWarpedScreenPos(o.position);
return o;
}
Expand Down
Binary file modified Assets/LeapMotion/Scenes/AllHandModels.unity
Binary file not shown.
Binary file modified Assets/LeapMotion/Scenes/CubeWave.unity
Binary file not shown.
Binary file modified Assets/LeapMotion/Scenes/Kaleidoscope.unity
Binary file not shown.
Binary file modified Assets/LeapMotion/Scenes/RecordAndPlayback.unity
Binary file not shown.
Binary file modified Assets/LeapMotion/Scenes/TooDarkToSee.unity
Binary file not shown.
14 changes: 9 additions & 5 deletions Assets/LeapMotion/Scripts/Utils/DisconnectionNotice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
\******************************************************************************/

using UnityEngine;
using System.Collections;
using Leap;

/**
* Tracks the connection state of the Leap Motion hardware. If the device is unplugged
* or otherwise not detected, the script fades in a GUITexture object which should communicate
* or otherwise not detected, the script fades in an Image which should communicate
* the problem to the user.
*/
public class DisconnectionNotice : MonoBehaviour {
Expand All @@ -23,8 +22,13 @@ public class DisconnectionNotice : MonoBehaviour {
public AnimationCurve fade;
/** A delay before beginning the fade-in effect. */
public int waitFrames = 10;

/** An alternative image to use when the hardware is embedded in a keyboard or laptop. */
public UnityEngine.UI.Image mainImage;

/** An alternative image to use when the hardware is embedded in a keyboard or laptop. */
public Texture2D embeddedReplacementImage;
public Sprite embeddedReplacementImage;

/** The fully on texture tint color. */
public Color onColor = Color.white;

Expand All @@ -38,7 +42,7 @@ void Start() {
}

void SetAlpha(float alpha) {
GetComponent<GUITexture>().color = Color.Lerp(Color.clear, onColor, alpha);
mainImage.color = Color.Lerp(Color.clear, onColor, alpha);
}

/** The connection state of the controller. */
Expand All @@ -56,7 +60,7 @@ bool IsEmbedded() {

void Update() {
if (embeddedReplacementImage != null && IsEmbedded()) {
GetComponent<GUITexture>().texture = embeddedReplacementImage;
mainImage.sprite = embeddedReplacementImage;
}

if (IsConnected())
Expand Down
5 changes: 2 additions & 3 deletions Assets/LeapMotion/Scripts/Utils/FitHeightToScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
\******************************************************************************/

using UnityEngine;
using System.Collections;

public class FitHeightToScreen : MonoBehaviour {

void Awake() {
float width_height_ratio = GetComponent<GUITexture>().texture.width / GetComponent<GUITexture>().texture.height;
float width_height_ratio = GetComponent<Sprite>().rect.width / GetComponent<Sprite>().rect.width;
float width = width_height_ratio * Screen.height;
float x_offset = (Screen.width - width) / 2.0f;
GetComponent<GUITexture>().pixelInset = new Rect(x_offset, 0.0f, width, Screen.height);
GetComponent<UnityEngine.UI.Image>().SetClipRect(new Rect(x_offset, 0.0f, width, Screen.height), true);
}
}

6 changes: 2 additions & 4 deletions Assets/LeapMotion/Scripts/Utils/StretchToScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
\******************************************************************************/

using UnityEngine;
using System.Collections;

public class StretchToScreen : MonoBehaviour {

void Awake() {
GetComponent<GUITexture>().pixelInset = new Rect(0.0f, 0.0f, Screen.width, Screen.height);
GetComponent<UnityEngine.UI.Image>().SetClipRect(new Rect(0.0f, 0.0f, Screen.width, Screen.height), true);
}
}

}
99 changes: 84 additions & 15 deletions Assets/LeapMotion/Textures/EnableEmbeddedLeapNotice.png.meta

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

Loading