Implement all todos

This commit is contained in:
Jens Pitkänen 2020-05-04 00:09:44 +03:00
parent bb9069da8c
commit ccd5e968aa
27 changed files with 4231 additions and 52 deletions

View File

@ -17,4 +17,4 @@ MonoBehaviour:
BurnTime: 0.5
FlameEffect: 0.3
SoundEffect: 0.8
Ignitable: 1
Ignitable: 0

View File

@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 89be129a0b3b303478d411ad4ec84e30, type: 3}
m_Name: Tutorial Note Burn Quality
m_EditorClassIdentifier:
DisplayName: stick
FuelValue: 10
BurnTime: 4
FlameEffect: 0.9
SoundEffect: 2
Ignitable: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dda70a9e5cda0fa48be61ba198172785
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 36bd22b7e049e974e8cf34a382a6245e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bdf0a5c8b972088458eb9031752a0b12
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Paper
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.075
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.9622642, g: 0.95657384, b: 0.92141336, a: 1}
- _EmissionColor: {r: 0.2924528, g: 0.28186718, b: 0.26348343, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d2cabe290f0bc7249aa12ac259feb941
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -5250,6 +5250,8 @@ MonoBehaviour:
Extinguished: 0
TorchDuration: 60
TorchWarnDuration: 15
MinDistanceFromTerrain: 0.2
FuelTickingMultiplierOnGround: 3
StickObject: {fileID: 8047787840955207861}
DestroyedOnExtinguish: {fileID: 8983857824270516560}
TorchObject: {fileID: 2973616090333718160}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: aaebb5cafb47fbf408359934bb5b1ae6
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2219,6 +2219,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2014920, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: near clip plane
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: 11401046, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: hoverLayerMask.m_Bits
value: 1024
@ -4503,7 +4507,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:
@ -8523,7 +8527,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}
@ -9401,7 +9405,7 @@ GameObject:
- component: {fileID: 833188480}
m_Layer: 15
m_Name: Terrain
m_TagString: Untagged
m_TagString: Main Terrain
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
@ -10020,7 +10024,7 @@ Transform:
- {fileID: 559135886}
- {fileID: 585607714}
m_Father: {fileID: 1660514110}
m_RootOrder: 22
m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &873845669
PrefabInstance:
@ -10097,6 +10101,12 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 873845669}
m_PrefabAsset: {fileID: 0}
--- !u!4 &874547082 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
m_PrefabInstance: {fileID: 2964009490481894397}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &875782497
PrefabInstance:
m_ObjectHideFlags: 0
@ -10138,7 +10148,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3}
propertyPath: m_RootOrder
value: 7
value: 8
objectReference: {fileID: 0}
- target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -12499,7 +12509,7 @@ PrefabInstance:
- target: {fileID: 388935964095823363, guid: 354995f43a462b04db424bdef965fd1d,
type: 3}
propertyPath: m_RootOrder
value: 23
value: 24
objectReference: {fileID: 0}
- target: {fileID: 388935964095823363, guid: 354995f43a462b04db424bdef965fd1d,
type: 3}
@ -14791,7 +14801,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}
@ -15194,7 +15204,7 @@ Transform:
- {fileID: 1129651174}
- {fileID: 1658658490}
m_Father: {fileID: 1660514110}
m_RootOrder: 21
m_RootOrder: 22
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &1310630590 stripped
Transform:
@ -16113,7 +16123,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}
@ -16425,7 +16435,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:
@ -17029,7 +17039,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:
@ -18053,13 +18063,8 @@ PrefabInstance:
objectReference: {fileID: 834592896}
- target: {fileID: 986826787110512831, guid: 8ee6eecf5317b4841817712d24763e37,
type: 3}
propertyPath: GoodFuelAmount
value: 45
objectReference: {fileID: 0}
- target: {fileID: 986826787110512831, guid: 8ee6eecf5317b4841817712d24763e37,
type: 3}
propertyPath: Fuel
value: 90
propertyPath: FuelTickingMultiplier
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1408567892783054407, guid: 8ee6eecf5317b4841817712d24763e37,
type: 3}
@ -18439,7 +18444,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}
@ -19544,6 +19549,7 @@ Transform:
- {fileID: 85607725}
- {fileID: 1195794718}
- {fileID: 1460458978}
- {fileID: 874547082}
- {fileID: 875782498}
- {fileID: 380838729}
- {fileID: 1872559113}
@ -19943,7 +19949,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:
@ -22160,7 +22166,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}
@ -23868,7 +23874,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:
@ -25423,7 +25429,7 @@ PrefabInstance:
- target: {fileID: 8533006164501396295, guid: 388bb253525fc3a4bab3e1dd21beb08c,
type: 3}
propertyPath: m_RootOrder
value: 19
value: 20
objectReference: {fileID: 0}
- target: {fileID: 8533006164501396295, guid: 388bb253525fc3a4bab3e1dd21beb08c,
type: 3}
@ -25460,6 +25466,99 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8df7bcbf7138e33448643b71967f880c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &2964009490481894397
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1660514110}
m_Modifications:
- target: {fileID: 874547083, guid: aaebb5cafb47fbf408359934bb5b1ae6, type: 3}
propertyPath: Hand
value:
objectReference: {fileID: 189615151}
- target: {fileID: 2964009488635626393, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 2964009489031357067, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 2964009489455070064, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609204, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_Name
value: Tutorial Note
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.881
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalPosition.z
value: -1.383
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.20107913
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.97957504
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 23.2
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2964009489611609207, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2964009490276564078, guid: aaebb5cafb47fbf408359934bb5b1ae6,
type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: aaebb5cafb47fbf408359934bb5b1ae6, type: 3}
--- !u!1001 &5400695019531174117
PrefabInstance:
m_ObjectHideFlags: 0
@ -25915,7 +26014,7 @@ PrefabInstance:
- target: {fileID: 6166170817692975782, guid: 8cf3939d3cb6e684c8ac9618e68c8259,
type: 3}
propertyPath: m_RootOrder
value: 18
value: 19
objectReference: {fileID: 0}
- target: {fileID: 6166170817692975782, guid: 8cf3939d3cb6e684c8ac9618e68c8259,
type: 3}
@ -26080,7 +26179,7 @@ PrefabInstance:
- target: {fileID: 9114811099361258696, guid: dce6ed08bb6da0a438a43d72fdf944da,
type: 3}
propertyPath: m_RootOrder
value: 20
value: 21
objectReference: {fileID: 0}
- target: {fileID: 9114811099361258696, guid: dce6ed08bb6da0a438a43d72fdf944da,
type: 3}

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using UnityEngine;
using Valve.VR.InteractionSystem;
[RequireComponent(typeof(Collider))]
public class Backpack : MonoBehaviour {
private class HapticPulse {
@ -78,11 +77,12 @@ public class Backpack : MonoBehaviour {
}
}
// TODO: Disable store when trying to store an ignited torch
public void Store(Hand hand) {
if (hand.currentAttachedObject != null) {
Throwable Item = hand.currentAttachedObject.GetComponent<Throwable>();
if (IsHandInBag(hand) && Item != null) {
ItemVR Torch = hand.currentAttachedObject.GetComponent<ItemVR>();
bool IsBurningTorch = Torch != null && (Torch.Ignited && !Torch.Extinguished);
if (IsHandInBag(hand) && Item != null && !IsBurningTorch) {
Contents.Add(Item);
hand.DetachObject(Item.gameObject);
Item.gameObject.SetActive(false);

View File

@ -1,6 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
[System.Serializable]
public enum StepType {
@ -17,7 +15,6 @@ public class CameraBobber : MonoBehaviour {
public bool Moving = false;
public bool InAir = false;
public AudioSource FootstepSource;
// TODO: Vary by ground material
public AudioClip[] LandingFootstepClips;
public AudioClip[] RightFootstepClips;
public AudioClip[] LeftFootstepClips;

View File

@ -1,5 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
public class Campfire : MonoBehaviour {
@ -8,6 +7,8 @@ public class Campfire : MonoBehaviour {
public Flame Flame;
public CampfireSfx Sfx;
public bool DebugDisableFuelMechanic;
[Tooltip("The speed at which fuel goes down. For example, 0.5 will cause the campfire to last twice as long.")]
public float FuelTickingMultiplier = 1;
public float GoodFuelAmount;
[Tooltip("The light turns this color when Fuel < GoodFuelAmount. Otherwise it'll be as it is in the editor.")]
public Color TooLowFuelColor;
@ -15,7 +16,6 @@ public class Campfire : MonoBehaviour {
public float RandomVarianceMagnitude;
[Tooltip("How long of a break the campfire takes between eating logs, if multiple are placed on it.")]
public float LogBurningCooldown;
[Header("Out-of-camp mechanic")]
public float CampRadius;
[Tooltip("Fuel won't go below this threshold if the player is outside of the camp.")]
@ -77,16 +77,25 @@ public class Campfire : MonoBehaviour {
}
private void TickFuel() {
float TickAmount = Time.deltaTime * FuelTickingMultiplier;
if (DebugDisableFuelMechanic) {
TickAmount = 0;
}
OutOfCamp = true;
if ((Player.position - transform.position).magnitude < CampRadius) {
// Player is inside of the camp, tick fuel at normal rate
Fuel -= DebugDisableFuelMechanic ? 0 : Time.deltaTime;
// In camp, tick at normal rate
OutOfCamp = false;
} else if (Fuel > OutOfCampFuelThreshold) {
// Player is outside of the camp, and the campfire is within safe levels, tick fuel at a slow rate
Fuel -= DebugDisableFuelMechanic ? 0 : Time.deltaTime * OutOfCampFuelRateMultiplier;
TickAmount *= OutOfCampFuelRateMultiplier;
} else {
// Player is outside of the camp, and the campfire is below the threshold, stop ticking fuel
// ( So they'll come back "just in time" ;) )
TickAmount = 0;
}
Fuel = Mathf.Max(0, Fuel);
Fuel = Mathf.Max(0, Fuel - TickAmount);
}
private bool BurnLog(Burnable burnable) {

View File

@ -14,6 +14,9 @@ public class CollisionSfx : MonoBehaviour {
private Rigidbody Body;
private float LastTimePlayed = 0;
private static float LastTimeGloballyPlayed = 0;
private static readonly float GlobalCooldown = 0.05f;
private void Awake() {
Body = GetComponent<Rigidbody>();
}
@ -23,8 +26,9 @@ public class CollisionSfx : MonoBehaviour {
}
private bool PlaySound() {
if (Time.time - LastTimePlayed >= EffectCooldown) {
if (Time.time - LastTimePlayed >= EffectCooldown && Time.time - LastTimeGloballyPlayed >= GlobalCooldown) {
LastTimePlayed = Time.time;
LastTimeGloballyPlayed = Time.time;
if (Clips.Length > 0) {
Source.PlayOneShot(Clips[Random.Range(0, Clips.Length)], Mathf.Sqrt(Body.velocity.magnitude));
return true;

View File

@ -1,10 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// TODO: Fix sound when in warn mode
// TODO: Clamp light to slightly above the terrain
// TODO: Increase fuel consumption on ground
using UnityEngine;
/*
* <summary>A replacement for the Item class in VR contexts.</summary>
@ -17,6 +11,8 @@ public class ItemVR : MonoBehaviour {
public bool Extinguished = false;
public float TorchDuration;
public float TorchWarnDuration;
public float MinDistanceFromTerrain;
public float FuelTickingMultiplierOnGround;
[Header("Burning indicators")]
public GameObject StickObject;
@ -37,11 +33,17 @@ public class ItemVR : MonoBehaviour {
private float IgnitionStartTime = -1;
private Color NormalColor;
private Terrain Terrain;
private Vector3 TorchLightBasePosition;
private void Start() {
Burnable = GetComponent<Burnable>();
NormalColor = TorchLight.color;
TorchObject.SetActive(Ignited);
StickObject.SetActive(!Ignited);
Terrain = GameObject.FindGameObjectWithTag("Main Terrain").GetComponent<Terrain>();
TorchLightBasePosition = TorchLight.transform.localPosition;
}
private void Update() {
@ -49,8 +51,21 @@ public class ItemVR : MonoBehaviour {
return;
}
if (Ignited && TorchLight.enabled) {
TorchFuel -= Time.deltaTime;
if (Ignited) {
float FuelTickAmount = Time.deltaTime;
TorchLight.transform.localPosition = TorchLightBasePosition;
Vector3 LightPosition = TorchLight.transform.position;
float MinHeight = (Terrain.SampleHeight(LightPosition) + Terrain.transform.position.y) + MinDistanceFromTerrain;
if (LightPosition.y < MinHeight) {
// The light is on ground, clamp it above round (so the light doesn't look weird)
// and start ticking fuel at a higher rate
LightPosition.y = MinHeight;
FuelTickAmount *= FuelTickingMultiplierOnGround;
}
TorchLight.transform.position = LightPosition;
TorchFuel -= FuelTickAmount;
if (TorchFuel < TorchWarnDuration) {
TorchLight.color = Color.Lerp(TorchLight.color, WarnColor, 5f * Time.deltaTime);
} else {
@ -63,7 +78,7 @@ public class ItemVR : MonoBehaviour {
TorchSound.Play();
}
float FuelFactor = 1f / (Mathf.Max(0, TorchDuration + 0.5f - TorchFuel) * 4f + 1);
TorchSound.volume = 0.4f + 0.6f * FuelFactor - (TorchFuel < TorchWarnDuration ? 0.3f : 0);
TorchSound.volume = 0.5f + 0.5f * FuelFactor - (TorchFuel < TorchWarnDuration ? 0.1f : 0);
if (TorchFuel <= 0) {
FireParticles.Stop();

View File

@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SfxPlayer : MonoBehaviour {
public AudioSource Source;
public AudioClip[] Clips;
private void Update() {
}
public void Play() {
if (enabled && Clips.Length > 0) {
Source.PlayOneShot(Clips[Random.Range(0, Clips.Length)]);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5176e76091fbe3d4290523f64a20913a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,29 @@
using UnityEngine;
using Valve.VR.InteractionSystem;
using Valve.VR;
public class StartsInHand : MonoBehaviour {
public Hand Hand;
public Hand.AttachmentFlags Flags;
public bool StillInitiallyAttached = true;
public MonoBehaviour[] EnableOnDeattach;
private void Update() {
if (StillInitiallyAttached) {
GrabTypes GrabType = GrabTypes.Scripted;
if (SteamVR_Actions.default_GrabGrip.state) {
StillInitiallyAttached = false;
GrabType = GrabTypes.Grip;
} else if (SteamVR_Actions.default_GrabPinch.state) {
StillInitiallyAttached = false;
GrabType = GrabTypes.Pinch;
}
if (!StillInitiallyAttached) {
foreach (MonoBehaviour Component in EnableOnDeattach) {
Component.enabled = true;
}
}
Hand.AttachObject(gameObject, GrabType, Flags);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ab1577b75fc0e314f8a52ec47a1b7d49
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,7 +7,7 @@ public class TerrainModelPlacer : MonoBehaviour {
private void Update() {
if (!Application.isPlaying) {
// Update is called in editor when values change
Terrain Terrain = GameObject.FindObjectOfType<Terrain>();
Terrain Terrain = GameObject.FindGameObjectWithTag("Main Terrain").GetComponent<Terrain>();
Vector3 Pos = transform.position;
Pos.y = Terrain.transform.position.y + Terrain.SampleHeight(Pos);
transform.position = Pos;

8
Assets/TextMesh Pro.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f54d1bd14bd3ca042bd867b519fee8cc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,165 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e90911e410742a1498a167540c7865bf, type: 3}
m_Name: PaperHoldPose
m_EditorClassIdentifier:
leftHand:
inputSource: 1
thumbFingerMovementType: 2
indexFingerMovementType: 2
middleFingerMovementType: 2
ringFingerMovementType: 2
pinkyFingerMovementType: 2
ignoreRootPoseData: 1
ignoreWristPoseData: 1
position: {x: 0, y: 0, z: 0}
rotation: {x: 0, y: -0, z: -0, w: -1}
bonePositions:
- {x: -0, y: 0, z: 0}
- {x: -0.1765, y: 0.037, z: 0.165}
- {x: -0.012083233, y: 0.028070247, z: 0.025049694}
- {x: 0.040405963, y: -0.000000051561553, z: 0.000000045447194}
- {x: 0.032516792, y: -0.000000051137583, z: -0.000000012933195}
- {x: 0.030463902, y: 0.00000016269207, z: 0.0000000792839}
- {x: 0.0006324522, y: 0.026866155, z: 0.015001948}
- {x: 0.074204385, y: 0.005002201, z: -0.00023377323}
- {x: 0.043930072, y: 0.000000059567498, z: 0.00000018367103}
- {x: 0.02869547, y: -0.00000009398158, z: -0.00000012649753}
- {x: 0.022821384, y: -0.00000014365155, z: 0.00000007651614}
- {x: 0.0021773134, y: 0.007119544, z: 0.016318738}
- {x: 0.07095288, y: -0.00077883265, z: -0.000997186}
- {x: 0.043108486, y: -0.00000009950596, z: -0.0000000067041825}
- {x: 0.033266045, y: -0.00000001320567, z: -0.000000021670374}
- {x: 0.025892371, y: 0.00000009984198, z: -0.0000000020352908}
- {x: 0.0005134356, y: -0.0065451227, z: 0.016347693}
- {x: 0.06587581, y: -0.0017857892, z: -0.00069344096}
- {x: 0.04069671, y: -0.000000095347104, z: -0.000000022934731}
- {x: 0.028746964, y: 0.00000010089892, z: 0.000000045306827}
- {x: 0.022430236, y: 0.00000010846127, z: -0.000000017428562}
- {x: -0.002478151, y: -0.01898137, z: 0.015213584}
- {x: 0.0628784, y: -0.0028440945, z: -0.0003315112}
- {x: 0.030219711, y: -0.00000003418319, z: -0.00000009332872}
- {x: 0.018186597, y: -0.0000000050220166, z: -0.00000020934549}
- {x: 0.01801794, y: -0.0000000200012, z: 0.0000000659746}
- {x: -0.0060591106, y: 0.05628522, z: 0.060063843}
- {x: -0.04041555, y: -0.043017667, z: 0.019344581}
- {x: -0.03935372, y: -0.07567404, z: 0.047048334}
- {x: -0.038340144, y: -0.09098663, z: 0.08257892}
- {x: -0.031805996, y: -0.08721431, z: 0.12101539}
boneRotations:
- {x: -6.123234e-17, y: 1, z: 6.123234e-17, w: -0.00000004371139}
- {x: -0.07860813, y: -0.9202793, z: 0.37929615, w: -0.055146646}
- {x: -0.31492096, y: -0.7531923, z: 0.2686886, w: 0.5112071}
- {x: 0.08441245, y: -0.011481911, z: -0.14945205, w: 0.98509234}
- {x: -0.0014429913, y: -0.02205448, z: 0.14284638, w: 0.9894981}
- {x: -1.3877788e-17, y: -1.3877788e-17, z: -5.551115e-17, w: 1}
- {x: -0.6442515, y: -0.42213318, z: -0.4782025, w: 0.42197865}
- {x: -0.006638095, y: 0.03918799, z: -0.41939738, w: 0.90693223}
- {x: 0.03847969, y: 0.024946187, z: -0.54401666, w: 0.83782035}
- {x: 0.0018504566, y: 0.022782495, z: 0.013409463, w: 0.9996488}
- {x: 6.938894e-18, y: 1.9428903e-16, z: -1.348151e-33, w: 1}
- {x: -0.546723, y: -0.46074906, z: -0.44252017, w: 0.54127645}
- {x: -0.18410894, y: 0.017735288, z: -0.39682534, w: 0.8990657}
- {x: 0.022716863, y: 0.00005104951, z: -0.63006335, w: 0.7762114}
- {x: -0.003327809, y: 0.028225154, z: 0.066315144, w: 0.9973939}
- {x: 1.1639192e-17, y: -5.602331e-17, z: -0.040125635, w: 0.9991947}
- {x: -0.5166922, y: -0.4298879, z: -0.49554786, w: 0.5501435}
- {x: -0.12046805, y: -0.0005977527, z: -0.44579774, w: 0.88699013}
- {x: -0.0018179449, y: -0.0013082434, z: -0.60677046, w: 0.79487395}
- {x: -0.00072132144, y: 0.012692659, z: -0.040420394, w: 0.9991019}
- {x: 6.938894e-18, y: -9.62965e-35, z: -1.3877788e-17, w: 1}
- {x: -0.5269183, y: -0.32674035, z: -0.5840246, w: 0.52394}
- {x: -0.1194684, y: 0.08688846, z: -0.5556242, w: 0.81820506}
- {x: 0.015258543, y: 0.0120855775, z: -0.54026496, w: 0.8412698}
- {x: -0.00201019, y: 0.052079126, z: 0.073525675, w: 0.99593055}
- {x: 0, y: 0, z: 1.9081958e-17, w: 1}
- {x: 0.20274544, y: 0.59426665, z: 0.2494411, w: 0.73723847}
- {x: 0.6235274, y: -0.66380864, z: -0.29373443, w: -0.29033053}
- {x: 0.6780625, y: -0.6592852, z: -0.26568344, w: -0.18704711}
- {x: 0.7367927, y: -0.6347571, z: -0.14393571, w: -0.18303718}
- {x: 0.7584072, y: -0.6393418, z: -0.12667806, w: -0.0036594148}
rightHand:
inputSource: 2
thumbFingerMovementType: 2
indexFingerMovementType: 2
middleFingerMovementType: 2
ringFingerMovementType: 2
pinkyFingerMovementType: 2
ignoreRootPoseData: 1
ignoreWristPoseData: 1
position: {x: 0, y: 0, z: 0}
rotation: {x: -0, y: -0, z: -0, w: 1}
bonePositions:
- {x: -0, y: 0, z: 0}
- {x: -0.1765, y: 0.037, z: 0.165}
- {x: -0.012083233, y: 0.028070247, z: 0.025049694}
- {x: 0.040405963, y: -0.000000051561553, z: 0.000000045447194}
- {x: 0.032516792, y: -0.000000051137583, z: -0.000000012933195}
- {x: 0.030463902, y: 0.00000016269207, z: 0.0000000792839}
- {x: 0.0006324522, y: 0.026866155, z: 0.015001948}
- {x: 0.074204385, y: 0.005002201, z: -0.00023377323}
- {x: 0.043930072, y: 0.000000059567498, z: 0.00000018367103}
- {x: 0.02869547, y: -0.00000009398158, z: -0.00000012649753}
- {x: 0.022821384, y: -0.00000014365155, z: 0.00000007651614}
- {x: 0.0021773134, y: 0.007119544, z: 0.016318738}
- {x: 0.07095288, y: -0.00077883265, z: -0.000997186}
- {x: 0.043108486, y: -0.00000009950596, z: -0.0000000067041825}
- {x: 0.033266045, y: -0.00000001320567, z: -0.000000021670374}
- {x: 0.025892371, y: 0.00000009984198, z: -0.0000000020352908}
- {x: 0.0005134356, y: -0.0065451227, z: 0.016347693}
- {x: 0.06587581, y: -0.0017857892, z: -0.00069344096}
- {x: 0.04069671, y: -0.000000095347104, z: -0.000000022934731}
- {x: 0.028746964, y: 0.00000010089892, z: 0.000000045306827}
- {x: 0.022430236, y: 0.00000010846127, z: -0.000000017428562}
- {x: -0.002478151, y: -0.01898137, z: 0.015213584}
- {x: 0.0628784, y: -0.0028440945, z: -0.0003315112}
- {x: 0.030219711, y: -0.00000003418319, z: -0.00000009332872}
- {x: 0.018186597, y: -0.0000000050220166, z: -0.00000020934549}
- {x: 0.01801794, y: -0.0000000200012, z: 0.0000000659746}
- {x: -0.0060591106, y: 0.05628522, z: 0.060063843}
- {x: -0.04041555, y: -0.043017667, z: 0.019344581}
- {x: -0.03935372, y: -0.07567404, z: 0.047048334}
- {x: -0.038340144, y: -0.09098663, z: 0.08257892}
- {x: -0.031805996, y: -0.08721431, z: 0.12101539}
boneRotations:
- {x: -6.123234e-17, y: 1, z: 6.123234e-17, w: -0.00000004371139}
- {x: -0.07860813, y: -0.9202793, z: 0.37929615, w: -0.055146646}
- {x: -0.31492096, y: -0.7531923, z: 0.2686886, w: 0.5112071}
- {x: 0.084412456, y: -0.011481911, z: -0.14945206, w: 0.98509234}
- {x: -0.0014429913, y: -0.02205448, z: 0.14284638, w: 0.9894981}
- {x: -1.3877788e-17, y: -1.3877788e-17, z: -5.551115e-17, w: 1}
- {x: -0.6442515, y: -0.42213318, z: -0.4782025, w: 0.42197865}
- {x: -0.006638095, y: 0.03918799, z: -0.41939738, w: 0.90693223}
- {x: 0.03847969, y: 0.024946187, z: -0.54401666, w: 0.83782035}
- {x: 0.0018504566, y: 0.022782495, z: 0.013409463, w: 0.9996488}
- {x: 6.938894e-18, y: 1.9428903e-16, z: -1.348151e-33, w: 1}
- {x: -0.546723, y: -0.46074906, z: -0.44252017, w: 0.54127645}
- {x: -0.18410893, y: 0.017735286, z: -0.3968253, w: 0.8990656}
- {x: 0.022716863, y: 0.00005104951, z: -0.63006335, w: 0.7762114}
- {x: -0.003327809, y: 0.028225154, z: 0.066315144, w: 0.9973939}
- {x: 1.1639192e-17, y: -5.602331e-17, z: -0.040125635, w: 0.9991947}
- {x: -0.5166922, y: -0.4298879, z: -0.49554786, w: 0.5501435}
- {x: -0.12046805, y: -0.0005977527, z: -0.44579774, w: 0.88699013}
- {x: -0.0018179449, y: -0.0013082434, z: -0.60677046, w: 0.79487395}
- {x: -0.00072132144, y: 0.012692659, z: -0.040420394, w: 0.9991019}
- {x: 6.938894e-18, y: -9.62965e-35, z: -1.3877788e-17, w: 1}
- {x: -0.5269183, y: -0.32674035, z: -0.5840246, w: 0.52394}
- {x: -0.1194684, y: 0.08688846, z: -0.5556242, w: 0.81820506}
- {x: 0.015258543, y: 0.0120855775, z: -0.54026496, w: 0.8412698}
- {x: -0.00201019, y: 0.052079126, z: 0.073525675, w: 0.99593055}
- {x: 0, y: 0, z: 1.9081958e-17, w: 1}
- {x: 0.20274544, y: 0.59426665, z: 0.2494411, w: 0.73723847}
- {x: 0.6235274, y: -0.66380864, z: -0.29373443, w: -0.29033053}
- {x: 0.6780625, y: -0.6592852, z: -0.26568344, w: -0.18704711}
- {x: 0.7367927, y: -0.6347571, z: -0.14393571, w: -0.18303718}
- {x: 0.7584072, y: -0.6393418, z: -0.12667806, w: -0.0036594148}
applyToSkeletonRoot: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0f481b556f4ccc448b0f1612e8446930
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -8,6 +8,7 @@ TagManager:
- World
- Generator
- Campfire
- Main Terrain
layers:
- Default
- TransparentFX