Fix some final vr bugs

This commit is contained in:
Jens Pitkänen 2020-06-13 02:12:10 +03:00
parent 489fe6f3ee
commit eb56148c8f
7 changed files with 123 additions and 96 deletions

View File

@ -181,7 +181,7 @@ MonoBehaviour:
value: 0
postExposure:
overrideState: 1
value: 0.5
value: 0
contrast:
overrideState: 0
value: 0

View File

@ -77,7 +77,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1065497410053260778}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.187}
m_LocalPosition: {x: 0, y: 0, z: 0.404}
m_LocalScale: {x: 0.02, y: 0.02, z: 0.02}
m_Children: []
m_Father: {fileID: 1065497409069962937}
@ -280,7 +280,7 @@ GameObject:
- component: {fileID: 6501963580037136219}
- component: {fileID: 3521054973383131517}
- component: {fileID: 4197915004906806136}
m_Layer: 0
m_Layer: 10
m_Name: Restart Switch
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -551,7 +551,7 @@ GameObject:
- component: {fileID: 7491570536230708532}
- component: {fileID: 1398608743716654988}
- component: {fileID: 6371056807367785877}
m_Layer: 0
m_Layer: 10
m_Name: Yanky Bit
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -646,7 +646,7 @@ GameObject:
- component: {fileID: 1131068171089457227}
- component: {fileID: 723347484104905059}
- component: {fileID: 5520755323509896478}
m_Layer: 0
m_Layer: 10
m_Name: Rope
m_TagString: Untagged
m_Icon: {fileID: 0}

View File

@ -211,7 +211,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 481068656}
- {fileID: 1089833010}
- {fileID: 1079986610}
m_Father: {fileID: 0}
m_RootOrder: 1
@ -416,6 +415,18 @@ PrefabInstance:
propertyPath: near clip plane
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: 2014920, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_BackGroundColor.r
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2014920, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_BackGroundColor.g
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2014920, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_BackGroundColor.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11401046, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: hoverLayerMask.m_Bits
value: 1024
@ -652,7 +663,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
Loraces: []
Radius: 1e0000000f00000028000000
Omnidirectional: 000001
Omnidirectional: 010101
CullingStatusChanged: 0
--- !u!114 &1079986623
MonoBehaviour:
@ -688,68 +699,6 @@ MonoBehaviour:
Cooldown: 5
AmbientNoiseCooldown: 0
Roll: 0
--- !u!1 &1089833009
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1089833010}
- component: {fileID: 1089833012}
- component: {fileID: 1089833011}
m_Layer: 8
m_Name: Post-process Volume
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1089833010
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089833009}
m_LocalRotation: {x: -0, y: -0.2131446, z: -0, w: 0.9770207}
m_LocalPosition: {x: 0.15, y: 0, z: -0.16}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 754586189}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: -24.613, z: 0}
--- !u!114 &1089833011
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089833009}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3}
m_Name:
m_EditorClassIdentifier:
sharedProfile: {fileID: 11400000, guid: 75c13987a1f059b4c9a659cb090dac8c, type: 2}
isGlobal: 0
blendDistance: 2
weight: 1
priority: 0
--- !u!65 &1089833012
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089833009}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 6, y: 3, z: 5}
m_Center: {x: 0, y: 1.5, z: 0}
--- !u!1 &1845374722
GameObject:
m_ObjectHideFlags: 0

View File

@ -4641,7 +4641,7 @@ Transform:
m_LocalScale: {x: 21.772371, y: 21.772371, z: 21.772371}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &380838730
MonoBehaviour:
@ -8789,7 +8789,7 @@ PrefabInstance:
- target: {fileID: 1537215554624875642, guid: 3d3251a3aedb46143931b1ea4eaa4138,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 13
objectReference: {fileID: 0}
- target: {fileID: 1537215554624875642, guid: 3d3251a3aedb46143931b1ea4eaa4138,
type: 3}
@ -10224,7 +10224,7 @@ Transform:
- {fileID: 559135886}
- {fileID: 585607714}
m_Father: {fileID: 1660514110}
m_RootOrder: 23
m_RootOrder: 24
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &873845669
PrefabInstance:
@ -10348,7 +10348,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3}
propertyPath: m_RootOrder
value: 6
value: 7
objectReference: {fileID: 0}
- target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -12715,7 +12715,7 @@ PrefabInstance:
- target: {fileID: 388935964095823363, guid: 354995f43a462b04db424bdef965fd1d,
type: 3}
propertyPath: m_RootOrder
value: 24
value: 25
objectReference: {fileID: 0}
- target: {fileID: 388935964095823363, guid: 354995f43a462b04db424bdef965fd1d,
type: 3}
@ -13225,7 +13225,7 @@ Transform:
m_Children:
- {fileID: 287774642}
m_Father: {fileID: 1660514110}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1130853765
MonoBehaviour:
@ -14604,7 +14604,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: -24.613, z: 0}
--- !u!114 &1213410465
MonoBehaviour:
@ -15218,7 +15218,7 @@ PrefabInstance:
- target: {fileID: 9033857765742716543, guid: a266bcf30ea85ae4f8457cbcd97ad222,
type: 3}
propertyPath: m_RootOrder
value: 14
value: 15
objectReference: {fileID: 0}
- target: {fileID: 9033857765742716543, guid: a266bcf30ea85ae4f8457cbcd97ad222,
type: 3}
@ -15621,7 +15621,7 @@ Transform:
- {fileID: 1129651174}
- {fileID: 1658658490}
m_Father: {fileID: 1660514110}
m_RootOrder: 22
m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &1310630590 stripped
Transform:
@ -16580,7 +16580,7 @@ PrefabInstance:
- target: {fileID: 1537215554624875642, guid: 3d3251a3aedb46143931b1ea4eaa4138,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 12
objectReference: {fileID: 0}
- target: {fileID: 1537215554624875642, guid: 3d3251a3aedb46143931b1ea4eaa4138,
type: 3}
@ -16852,6 +16852,68 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 65b9ab5277d05de459f2091021e0ee01, type: 3}
--- !u!1 &1463107305
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1463107306}
- component: {fileID: 1463107308}
- component: {fileID: 1463107307}
m_Layer: 8
m_Name: Post-process Volume
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1463107306
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1463107305}
m_LocalRotation: {x: -0, y: -0.2131446, z: -0, w: 0.9770207}
m_LocalPosition: {x: 0.15, y: 0, z: -0.16}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: -24.613, z: 0}
--- !u!114 &1463107307
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1463107305}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3}
m_Name:
m_EditorClassIdentifier:
sharedProfile: {fileID: 11400000, guid: 75c13987a1f059b4c9a659cb090dac8c, type: 2}
isGlobal: 0
blendDistance: 2
weight: 1
priority: 0
--- !u!65 &1463107308
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1463107305}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 6, y: 3, z: 5}
m_Center: {x: 0, y: 1.5, z: 0}
--- !u!1 &1467350794
GameObject:
m_ObjectHideFlags: 0
@ -16881,7 +16943,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 15
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!215 &1467350796
ReflectionProbe:
@ -17485,7 +17547,7 @@ Transform:
m_LocalScale: {x: 50, y: 1, z: 50}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 16
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!64 &1519600968
MeshCollider:
@ -18900,7 +18962,7 @@ PrefabInstance:
- target: {fileID: 8265150240760341263, guid: 8ee6eecf5317b4841817712d24763e37,
type: 3}
propertyPath: m_RootOrder
value: 9
value: 10
objectReference: {fileID: 0}
- target: {fileID: 8265150240760341263, guid: 8ee6eecf5317b4841817712d24763e37,
type: 3}
@ -19923,6 +19985,7 @@ Transform:
- {fileID: 237467734}
- {fileID: 833188479}
- {fileID: 958093121}
- {fileID: 1463107306}
- {fileID: 1213410464}
- {fileID: 1195794718}
- {fileID: 874547082}
@ -20327,7 +20390,7 @@ Transform:
- {fileID: 35399133}
- {fileID: 1808691935}
m_Father: {fileID: 1660514110}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1708470768
PrefabInstance:
@ -22918,7 +22981,7 @@ PrefabInstance:
- target: {fileID: 1537215554624875642, guid: 3d3251a3aedb46143931b1ea4eaa4138,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 14
objectReference: {fileID: 0}
- target: {fileID: 1537215554624875642, guid: 3d3251a3aedb46143931b1ea4eaa4138,
type: 3}
@ -24626,7 +24689,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 17
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2009628692
MonoBehaviour:
@ -25834,7 +25897,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 18
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2119012272
MonoBehaviour:
@ -26166,7 +26229,7 @@ PrefabInstance:
- target: {fileID: 8533006164501396295, guid: 388bb253525fc3a4bab3e1dd21beb08c,
type: 3}
propertyPath: m_RootOrder
value: 20
value: 21
objectReference: {fileID: 0}
- target: {fileID: 8533006164501396295, guid: 388bb253525fc3a4bab3e1dd21beb08c,
type: 3}
@ -26276,7 +26339,7 @@ PrefabInstance:
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_RootOrder
value: 5
value: 6
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
@ -26298,6 +26361,11 @@ PrefabInstance:
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 6120470380740374881, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: hoverPriority
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: aaebb5cafb47fbf408359934bb5b1ae6, type: 3}
--- !u!1001 &4511427499164458229
@ -26633,7 +26701,7 @@ PrefabInstance:
- target: {fileID: 6125707630481988396, guid: 558201eae20fa5540a826edb23937665,
type: 3}
propertyPath: m_RootOrder
value: 4
value: 5
objectReference: {fileID: 0}
- target: {fileID: 6125707630481988396, guid: 558201eae20fa5540a826edb23937665,
type: 3}
@ -26847,7 +26915,7 @@ PrefabInstance:
- target: {fileID: 6166170817692975782, guid: 8cf3939d3cb6e684c8ac9618e68c8259,
type: 3}
propertyPath: m_RootOrder
value: 19
value: 20
objectReference: {fileID: 0}
- target: {fileID: 6166170817692975782, guid: 8cf3939d3cb6e684c8ac9618e68c8259,
type: 3}
@ -27012,7 +27080,7 @@ PrefabInstance:
- target: {fileID: 9114811099361258696, guid: dce6ed08bb6da0a438a43d72fdf944da,
type: 3}
propertyPath: m_RootOrder
value: 21
value: 22
objectReference: {fileID: 0}
- target: {fileID: 9114811099361258696, guid: dce6ed08bb6da0a438a43d72fdf944da,
type: 3}

View File

@ -31,12 +31,21 @@ public class CampfireSfx : MonoBehaviour {
}
bool StartEndClip = Campfire.TimeToEnd <= EndClip.length && AmbientSource.clip != EndClip;
bool StopEndClip = AmbientSource.clip == EndClip && (Campfire.TimeToEnd > EndClip.length || GameState.Current == State.Paused);
bool StopEndClip = AmbientSource.clip == EndClip && (Campfire.TimeToEnd > EndClip.length - AmbientSource.time || GameState.Current == State.Paused);
if (StartEndClip) {
AmbientSource.clip = EndClip;
AmbientSource.time = Mathf.Clamp(EndClip.length - Campfire.TimeToEnd, 0, EndClip.length - 0.01f);
AmbientSource.Play();
} else if (StopEndClip || NeedsRefresh(AmbientSource)) {
} else if (StopEndClip) {
if (Campfire.TimeToEnd <= EndClip.length) {
// This will happen if the campfire is near the end, but sticks get thrown in,
// so the end clip should "skip back" a little to arrive at the end at the
// right time.
AmbientSource.time = Mathf.Clamp(EndClip.length - Campfire.TimeToEnd, 0, EndClip.length - 0.01f);
} else {
Refresh(AmbientSource, AmbientClips);
}
} else if (NeedsRefresh(AmbientSource)) {
Refresh(AmbientSource, AmbientClips);
}

View File

@ -7,7 +7,7 @@ public class GameOverVR : MonoBehaviour {
public GameState GameState;
private void Update() {
DarknessVolume.weight = Mathf.Lerp(DarknessVolume.weight, GameState.Current == State.GameOver ? 1 : 0, 3f * Time.deltaTime);
DarknessVolume.weight = Mathf.Lerp(DarknessVolume.weight, GameState.Current == State.GameOver ? 1 : 0, 0.5f * Time.deltaTime);
if (DarknessVolume.weight >= 0.99) {
SceneManager.LoadScene("Scenes/VRGameOverScene");
}

View File

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoraxCuller : MonoBehaviour {
public Lorax[] Loraces;
@ -14,8 +15,8 @@ public class LoraxCuller : MonoBehaviour {
private int LastAngle = int.MaxValue;
private void Update() {
if (Loraces.Length == 0) {
// Not in the world of the lorax yet.
if (SceneManager.GetActiveScene().name != "VRScene") {
LastX = LastY = LastAngle = int.MaxValue;
return;
}