Skip to content

Commit 7989d0e

Browse files
committed
Merge pull request #33 from JeroMiya/Unity5Compatibility
Updates for improved Unity 5 compatibility.
2 parents 046c709 + 5263213 commit 7989d0e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

OSVR-Unity/Assets/OSVRUnity/Sample/Demo/Scripts/Objects/ColorChanger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class ColorChanger : MonoBehaviour, IColorChanger
4242
#region Init
4343
void Awake()
4444
{
45-
_material = renderer.materials[materialID];
45+
_material = GetComponent<Renderer>().materials[materialID];
4646
}
4747
#endregion
4848

OSVR-Unity/Assets/OSVRUnity/src/OsvrPostEffectsBase.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ protected bool CheckSupport (bool needDepth) {
112112
return false;
113113
}
114114

115-
if(needDepth)
116-
camera.depthTextureMode |= DepthTextureMode.Depth;
117-
115+
if (needDepth) {
116+
GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;
117+
}
118+
118119
return true;
119120
}
120121

0 commit comments

Comments
 (0)