Skip to content

Commit

Permalink
updated LOI to the newest Unity and to support new VR systems. Tested…
Browse files Browse the repository at this point in the history
… on an Oculus DK2, but should work for newest systems, as well as Vive and other VR headsets that Unity supports
  • Loading branch information
Olivier Hokke committed Sep 28, 2018
1 parent 8ecc16f commit ba40b84
Show file tree
Hide file tree
Showing 228 changed files with 35,936 additions and 63,349 deletions.
Binary file not shown.

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

4 changes: 2 additions & 2 deletions Assets/AstoundSound/SoundSystemManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ void Start()

public static void HandleAudioSource(GameObject gameObject)
{
if (gameObject.audio != null)
if (gameObject.GetComponent<AudioSource>() != null)
{
HandleAudioSource(gameObject.audio);
HandleAudioSource(gameObject.GetComponent<AudioSource>());
}
}

Expand Down
6 changes: 4 additions & 2 deletions Assets/Depth Renderer.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Shader "Depth/Depth Renderer" {
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Depth/Depth Renderer" {
Properties {
_DepthStart ("Start", float) = 0
_DepthEnd ("End", float) = 100
Expand All @@ -22,7 +24,7 @@ Properties {

void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input,o);
float3 foo = mul(UNITY_MATRIX_MVP, v.vertex);
float3 foo = UnityObjectToClipPos(v.vertex);
o.depth = clamp((foo.z - _DepthStart) / (_DepthEnd - _DepthStart), 0, 1);
}

Expand Down
4 changes: 2 additions & 2 deletions Assets/DepthRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public void SetDepthRenderer(bool active, float start, float end)
if (active && !activated)
{
activated = true;
camera.SetReplacementShader(depthRenderer, "");
GetComponent<Camera>().SetReplacementShader(depthRenderer, "");
}
else if (!active && activated)
{
activated = false;
camera.ResetReplacementShader();
GetComponent<Camera>().ResetReplacementShader();
}
}

Expand Down
4 changes: 2 additions & 2 deletions Assets/EdgeDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ void OnTriggerEnter(Collider col)
{
if (EdgeManager.instance == null)
return;
EdgeManager.instance.EdgeTriggerEnter(this.collider, col);
EdgeManager.instance.EdgeTriggerEnter(this.GetComponent<Collider>(), col);
}

void OnTriggerExit(Collider col)
{
if (EdgeManager.instance == null)
return;
EdgeManager.instance.EdgeTriggerExit(this.collider, col);
EdgeManager.instance.EdgeTriggerExit(this.GetComponent<Collider>(), col);
}
}
4 changes: 2 additions & 2 deletions Assets/Editor/Image Effects/BloomAndLensFlaresEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class BloomAndLensFlaresEditor extends Editor
EditorGUILayout.PropertyField (hdr, new GUIContent("HDR"));

// display info text when screen blend mode cannot be used
var cam : Camera = (target as BloomAndLensFlares).camera;
var cam : Camera = (target as BloomAndLensFlares).GetComponent.<Camera>();
if(cam != null) {
if(screenBlendMode.enumValueIndex==0 && ((cam.hdr && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
if(screenBlendMode.enumValueIndex==0 && ((cam.allowHDR && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
EditorGUILayout.HelpBox("Screen blend is not supported in HDR. Using 'Add' instead.", MessageType.Info);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Editor/Image Effects/BloomEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class BloomEditor extends Editor
EditorGUILayout.Separator ();

// display info text when screen blend mode cannot be used
var cam : Camera = (target as Bloom).camera;
var cam : Camera = (target as Bloom).GetComponent.<Camera>();
if(cam != null) {
if(screenBlendMode.enumValueIndex==0 && ((cam.hdr && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
if(screenBlendMode.enumValueIndex==0 && ((cam.allowHDR && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
EditorGUILayout.HelpBox("Screen blend is not supported in HDR. Using 'Add' instead.", MessageType.Info);
}
}
Expand Down
8 changes: 4 additions & 4 deletions Assets/Editor/Image Effects/CameraMotionBlurEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CameraMotionBlurEditor extends Editor
var serObj : SerializedObject;

var filterType : SerializedProperty;
var preview : SerializedProperty;
var preview2 : SerializedProperty;
var previewScale : SerializedProperty;
var movementScale : SerializedProperty;
var jitter : SerializedProperty;
Expand All @@ -28,7 +28,7 @@ class CameraMotionBlurEditor extends Editor

filterType = serObj.FindProperty ("filterType");

preview = serObj.FindProperty ("preview");
preview2 = serObj.FindProperty ("preview");
previewScale = serObj.FindProperty ("previewScale");

movementScale = serObj.FindProperty ("movementScale");
Expand Down Expand Up @@ -89,8 +89,8 @@ class CameraMotionBlurEditor extends Editor

EditorGUILayout.Separator ();

EditorGUILayout.PropertyField (preview, new GUIContent("Preview"));
if (preview.boolValue)
EditorGUILayout.PropertyField (preview2, new GUIContent("Preview"));
if (this.preview2.boolValue)
EditorGUILayout.PropertyField (previewScale, new GUIContent(""));

serObj.ApplyModifiedProperties();
Expand Down
14 changes: 7 additions & 7 deletions Assets/Editor/Image Effects/DepthOfField34Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ class DepthOfField34Editor extends Editor
if (!go)
return;

if (!go.camera)
if (!go.GetComponent.<Camera>())
return;

if (simpleTweakMode.boolValue)
GUILayout.Label ("Current: "+go.camera.name+", near "+go.camera.nearClipPlane+", far: "+go.camera.farClipPlane+", focal: "+focalPoint.floatValue, EditorStyles.miniBoldLabel);
GUILayout.Label ("Current: "+go.GetComponent.<Camera>().name+", near "+go.GetComponent.<Camera>().nearClipPlane+", far: "+go.GetComponent.<Camera>().farClipPlane+", focal: "+focalPoint.floatValue, EditorStyles.miniBoldLabel);
else
GUILayout.Label ("Current: "+go.camera.name+", near "+go.camera.nearClipPlane+", far: "+go.camera.farClipPlane+", focal: "+focalZDistance.floatValue, EditorStyles.miniBoldLabel);
GUILayout.Label ("Current: "+go.GetComponent.<Camera>().name+", near "+go.GetComponent.<Camera>().nearClipPlane+", far: "+go.GetComponent.<Camera>().farClipPlane+", focal: "+focalZDistance.floatValue, EditorStyles.miniBoldLabel);

EditorGUILayout.PropertyField (resolution, new GUIContent("Resolution"));
EditorGUILayout.PropertyField (quality, new GUIContent("Quality"));
Expand All @@ -102,15 +102,15 @@ class DepthOfField34Editor extends Editor
GUILayout.Label ("Focal Settings", EditorStyles.boldLabel);

if (simpleTweakMode.boolValue) {
focalPoint.floatValue = EditorGUILayout.Slider ("Focal distance", focalPoint.floatValue, go.camera.nearClipPlane, go.camera.farClipPlane);
focalPoint.floatValue = EditorGUILayout.Slider ("Focal distance", focalPoint.floatValue, go.GetComponent.<Camera>().nearClipPlane, go.GetComponent.<Camera>().farClipPlane);
EditorGUILayout.PropertyField (objectFocus, new GUIContent("Transform"));
EditorGUILayout.PropertyField (smoothness, new GUIContent("Smoothness"));
focalSize.floatValue = EditorGUILayout.Slider ("Focal size", focalSize.floatValue, 0.0f, (go.camera.farClipPlane - go.camera.nearClipPlane));
focalSize.floatValue = EditorGUILayout.Slider ("Focal size", focalSize.floatValue, 0.0f, (go.GetComponent.<Camera>().farClipPlane - go.GetComponent.<Camera>().nearClipPlane));
}
else {
focalZDistance.floatValue = EditorGUILayout.Slider ("Distance", focalZDistance.floatValue, go.camera.nearClipPlane, go.camera.farClipPlane);
focalZDistance.floatValue = EditorGUILayout.Slider ("Distance", focalZDistance.floatValue, go.GetComponent.<Camera>().nearClipPlane, go.GetComponent.<Camera>().farClipPlane);
EditorGUILayout.PropertyField (objectFocus, new GUIContent("Transform"));
focalSize.floatValue = EditorGUILayout.Slider ("Size", focalSize.floatValue, 0.0f, (go.camera.farClipPlane - go.camera.nearClipPlane));
focalSize.floatValue = EditorGUILayout.Slider ("Size", focalSize.floatValue, 0.0f, (go.GetComponent.<Camera>().farClipPlane - go.GetComponent.<Camera>().nearClipPlane));
focalStartCurve.floatValue = EditorGUILayout.Slider ("Start curve", focalStartCurve.floatValue, 0.05f, 20.0f);
focalEndCurve.floatValue = EditorGUILayout.Slider ("End curve", focalEndCurve.floatValue, 0.05f, 20.0f);
}
Expand Down
12 changes: 6 additions & 6 deletions Assets/Editor/Image Effects/SunShaftsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class SunShaftsEditor extends Editor

var oldVal : boolean = useDepthTexture.boolValue;
EditorGUILayout.PropertyField (useDepthTexture, new GUIContent ("Rely on Z Buffer?"));
if((target as SunShafts).camera)
GUILayout.Label("Current camera mode: "+ (target as SunShafts).camera.depthTextureMode, EditorStyles.miniBoldLabel);
if((target as SunShafts).GetComponent.<Camera>())
GUILayout.Label("Current camera mode: "+ (target as SunShafts).GetComponent.<Camera>().depthTextureMode, EditorStyles.miniBoldLabel);

EditorGUILayout.EndHorizontal();

Expand All @@ -70,10 +70,10 @@ class SunShaftsEditor extends Editor
EditorGUILayout.BeginHorizontal();

EditorGUILayout.PropertyField (sunTransform, new GUIContent("Shafts caster", "Chose a transform that acts as a root point for the produced sun shafts"));
if((target as SunShafts).sunTransform && (target as SunShafts).camera) {
if (GUILayout.Button("Center on " + (target as SunShafts).camera.name)) {
if (EditorUtility.DisplayDialog ("Move sun shafts source?", "The SunShafts caster named "+ (target as SunShafts).sunTransform.name +"\n will be centered along "+(target as SunShafts).camera.name+". Are you sure? ", "Please do", "Don't")) {
var ray : Ray = (target as SunShafts).camera.ViewportPointToRay(Vector3(0.5,0.5,0));
if((target as SunShafts).sunTransform && (target as SunShafts).GetComponent.<Camera>()) {
if (GUILayout.Button("Center on " + (target as SunShafts).GetComponent.<Camera>().name)) {
if (EditorUtility.DisplayDialog ("Move sun shafts source?", "The SunShafts caster named "+ (target as SunShafts).sunTransform.name +"\n will be centered along "+(target as SunShafts).GetComponent.<Camera>().name+". Are you sure? ", "Please do", "Don't")) {
var ray : Ray = (target as SunShafts).GetComponent.<Camera>().ViewportPointToRay(Vector3(0.5,0.5,0));
(target as SunShafts).sunTransform.position = ray.origin + ray.direction * 500.0;
(target as SunShafts).sunTransform.LookAt ((target as SunShafts).transform);
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Editor/Image Effects/TonemappingEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class TonemappingEditor extends Editor

GUILayout.Label("Mapping HDR to LDR ranges since 1982", EditorStyles.miniLabel);

var cam : Camera = (target as Tonemapping).camera;
var cam : Camera = (target as Tonemapping).GetComponent.<Camera>();
if(cam != null) {
if(!cam.hdr) {
if(!cam.allowHDR) {
EditorGUILayout.HelpBox("The camera is not HDR enabled. This will likely break the Tonemapper.", MessageType.Warning);
}
else if(!(target as Tonemapping).validRenderTextureFormat) {
Expand Down
8 changes: 4 additions & 4 deletions Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public static void SetMaterialTexture(System.String theName, Texture parameter,

public static Material LocateValidWaterMaterial(Transform parent)
{
if(parent.renderer && parent.renderer.sharedMaterial)
return parent.renderer.sharedMaterial;
if(parent.GetComponent<Renderer>() && parent.GetComponent<Renderer>().sharedMaterial)
return parent.GetComponent<Renderer>().sharedMaterial;
foreach( Transform t in parent)
{
if(t.renderer && t.renderer.sharedMaterial)
return t.renderer.sharedMaterial;
if(t.GetComponent<Renderer>() && t.GetComponent<Renderer>().sharedMaterial)
return t.GetComponent<Renderer>().sharedMaterial;
}
return null;
}
Expand Down
Loading

0 comments on commit ba40b84

Please sign in to comment.