Implement vr torches

This commit is contained in:
Jens Pitkänen 2020-04-30 03:26:18 +03:00
parent b5550ada73
commit d5d905a1f1
10 changed files with 5690 additions and 452 deletions

View File

@ -75,6 +75,7 @@ Material:
- _DistortionStrengthScaled: 0 - _DistortionStrengthScaled: 0
- _DstBlend: 10 - _DstBlend: 10
- _EmissionEnabled: 0 - _EmissionEnabled: 0
- _FalloffPow: 2
- _FlipbookMode: 0 - _FlipbookMode: 0
- _GlossMapScale: 1 - _GlossMapScale: 1
- _Glossiness: 0.5 - _Glossiness: 0.5
@ -95,7 +96,7 @@ Material:
- _ZWrite: 0 - _ZWrite: 0
m_Colors: m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 0.24705866, g: 0.4666664, b: 0.5, a: 0.5019608} - _Color: {r: 0.2470586, g: 0.4666664, b: 0.5, a: 0.2}
- _ColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0} - _ColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}

View File

@ -39,6 +39,7 @@ Transform:
- {fileID: 8279143985661205166} - {fileID: 8279143985661205166}
- {fileID: 7662489421148146333} - {fileID: 7662489421148146333}
- {fileID: 2738699342724056705} - {fileID: 2738699342724056705}
- {fileID: 2650369790819247459}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -132,6 +133,51 @@ Rigidbody:
m_Interpolate: 0 m_Interpolate: 0
m_Constraints: 0 m_Constraints: 0
m_CollisionDetection: 0 m_CollisionDetection: 0
--- !u!1 &2924572221968050171
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2650369790819247459}
- component: {fileID: 5633977716718901277}
m_Layer: 17
m_Name: Fire Trigger
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2650369790819247459
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2924572221968050171}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8265150240760341263}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &5633977716718901277
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2924572221968050171}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0.5, z: 0}
--- !u!1 &3090626986165219207 --- !u!1 &3090626986165219207
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -1,446 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &323167668943071810
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4537129283620474398}
m_Layer: 10
m_Name: Stick Root
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4537129283620474398
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 323167668943071810}
m_LocalRotation: {x: 0.41627103, y: -0.01019779, z: 0.022266442, w: 0.9089107}
m_LocalPosition: {x: -0.009, y: 0.09, z: -0.036}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4295605565537018981}
- {fileID: 7722979984909929174}
- {fileID: 8934967594637573488}
- {fileID: 1711730649631156610}
m_Father: {fileID: 1830340994370403595}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 49.214, y: 0, z: 2.8070002}
--- !u!1 &1774343341489610875
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1711730649631156610}
- component: {fileID: 7965271002899560656}
m_Layer: 10
m_Name: Interaction Trigger
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1711730649631156610
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1774343341489610875}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4537129283620474398}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &7965271002899560656
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1774343341489610875}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
m_Radius: 0.1
m_Height: 0.6
m_Direction: 1
m_Center: {x: 0.005, y: 0, z: 0.005}
--- !u!1 &2086008818391599545
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1830340994370403595}
- component: {fileID: 1732996613952540235}
- component: {fileID: 1066568521765371770}
- component: {fileID: 2499151591214202486}
- component: {fileID: 5807904180460221178}
m_Layer: 10
m_Name: Stick VR
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1830340994370403595
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086008818391599545}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4537129283620474398}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!54 &1732996613952540235
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086008818391599545}
serializedVersion: 2
m_Mass: 0.4
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &1066568521765371770
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086008818391599545}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b93b6a877adcbf94c89a9d6e0c0e844d, type: 3}
m_Name:
m_EditorClassIdentifier:
activateActionSetOnAttach:
actionSetPath:
hideHandOnAttach: 0
hideSkeletonOnAttach: 0
hideControllerOnAttach: 0
handAnimationOnPickup: 0
setRangeOfMotionOnPickup: -1
useHandObjectAttachmentPoint: 1
attachEaseIn: 0
snapAttachEaseInCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
snapAttachEaseInTime: 0.15
snapAttachEaseInCompleted: 0
skeletonPoser: {fileID: 0}
handFollowTransform: 1
highlightOnHover: 1
hideHighlight: []
hoverPriority: 0
--- !u!114 &2499151591214202486
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086008818391599545}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e7418c7dd8f977d4e969202d3fa7e926, type: 3}
m_Name:
m_EditorClassIdentifier:
poseEditorExpanded: 1
blendEditorExpanded: 1
poseNames:
- StickHoldPose (MAIN)
overridePreviewLeftHandPrefab: {fileID: 1000013348574242, guid: 638779290bce1af49b356f33dcc6fccf,
type: 3}
overridePreviewRightHandPrefab: {fileID: 1000010304998954, guid: 6def53d002137b747aec0b29551e0e25,
type: 3}
skeletonMainPose: {fileID: 11400000, guid: 7d44e06d0a950e84d8906232374c8ac3, type: 2}
skeletonAdditionalPoses: []
showLeftPreview: 0
showRightPreview: 0
previewLeftInstance: {fileID: 0}
previewRightInstance: {fileID: 0}
previewPoseSelection: 0
blendingBehaviours: []
scale: 1
--- !u!114 &5807904180460221178
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086008818391599545}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ffefbea063cab884ca33e5a449e5c22c, type: 3}
m_Name:
m_EditorClassIdentifier:
attachmentFlags: 44
attachmentOffset: {fileID: 0}
catchingSpeedThreshold: -1
releaseVelocityStyle: 1
releaseVelocityTimeOffset: -0.011
scaleReleaseVelocity: 1.1
scaleReleaseVelocityThreshold: -1
scaleReleaseVelocityCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
restoreOriginalParent: 0
onPickUp:
m_PersistentCalls:
m_Calls: []
onDetachFromHand:
m_PersistentCalls:
m_Calls: []
onHeldUpdate:
m_PersistentCalls:
m_Calls: []
interactable: {fileID: 0}
--- !u!1 &7882310482220326929
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8934967594637573488}
m_Layer: 10
m_Name: Ignite Point
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8934967594637573488
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7882310482220326929}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.006, y: 0.218, z: -0.008}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4537129283620474398}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8445609960004857605
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7722979984909929174}
- component: {fileID: 8953589864355665736}
m_Layer: 10
m_Name: Collider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7722979984909929174
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8445609960004857605}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4537129283620474398}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &8953589864355665736
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8445609960004857605}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.05, y: 0.48, z: 0.06}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &9144482413452185471
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 4537129283620474398}
m_Modifications:
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.23
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.011
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalScale.x
value: 200
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalScale.y
value: 200.00002
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_LocalScale.z
value: 200.00002
objectReference: {fileID: 0}
- target: {fileID: -1504981713932161579, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 80996928df7a0d847bbb7a283c52976b, type: 2}
- target: {fileID: -1504981713932161579, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_CastShadows
value: 0
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_Name
value: Stick
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 88768e5e916bdea47b890bb833348313, type: 3}
--- !u!4 &4295605565537018981 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 88768e5e916bdea47b890bb833348313,
type: 3}
m_PrefabInstance: {fileID: 9144482413452185471}
m_PrefabAsset: {fileID: 0}

File diff suppressed because it is too large Load Diff

View File

@ -2149,7 +2149,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: -0.1945 value: -0.20967674
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@ -7255,7 +7255,7 @@ MonoBehaviour:
- {fileID: 6166170816655763454} - {fileID: 6166170816655763454}
- {fileID: 2718555727500931746} - {fileID: 2718555727500931746}
- {fileID: 675824348} - {fileID: 675824348}
Radius: 280000001400000032000000 Radius: 1e0000000f00000028000000
Omnidirectional: 000001 Omnidirectional: 000001
CullingStatusChanged: 0 CullingStatusChanged: 0
--- !u!4 &675824347 stripped --- !u!4 &675824347 stripped
@ -9905,7 +9905,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 11445746, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} - target: {fileID: 11445746, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3}
propertyPath: traceLayerMask.m_Bits propertyPath: traceLayerMask.m_Bits
value: 4294967295 value: 69633
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 11445746, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} - target: {fileID: 11445746, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3}
propertyPath: floorFixupTraceLayerMask.m_Bits propertyPath: floorFixupTraceLayerMask.m_Bits

78
Assets/Scripts/ItemVR.cs Normal file
View File

@ -0,0 +1,78 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*
* <summary>A replacement for the Item class in VR contexts.</summary>
*/
public class ItemVR : MonoBehaviour {
public BurnQuality Quality;
public BurnQuality IgnitedQuality;
public float IgniteDuration;
public bool Ignited = false;
public float TorchDuration;
public float TorchWarnDuration;
[Header("Burning indicators")]
public GameObject StickObject;
public GameObject TorchObject;
public ParticleSystem FireParticles;
public Light TorchLight;
public Color WarnColor;
[Header("Runtime values")]
public float TorchFuel;
private int BurningSourceCount = 0;
private float IgnitionStartTime = -1;
private Color NormalColor;
private void Start() {
NormalColor = TorchLight.color;
TorchObject.SetActive(Ignited);
StickObject.SetActive(!Ignited);
}
private void Update() {
if (Ignited && TorchLight.enabled) {
TorchFuel -= Time.deltaTime;
if (TorchFuel < TorchWarnDuration) {
TorchLight.color = Color.Lerp(TorchLight.color, WarnColor, 5f * Time.deltaTime);
} else {
TorchLight.color = Color.Lerp(TorchLight.color, NormalColor, 5f * Time.deltaTime);
}
if (TorchFuel <= 0) {
FireParticles.Stop();
TorchLight.range = Mathf.Lerp(TorchLight.range, 0, 10f * Time.deltaTime);
if (TorchLight.range < 0.01f) {
TorchLight.enabled = false;
}
}
} else if (!Ignited && IgnitionStartTime != -1 && Time.time - IgnitionStartTime >= IgniteDuration) {
Ignited = true;
TorchFuel = TorchDuration;
TorchObject.SetActive(true);
FireParticles.Play();
StickObject.SetActive(false);
Quality = IgnitedQuality;
}
}
private void OnTriggerEnter(Collider collider) {
if (!Ignited && collider.gameObject.layer == LayerMask.NameToLayer("Fire")) {
if (BurningSourceCount == 0) {
IgnitionStartTime = Time.time;
}
BurningSourceCount++;
}
}
private void OnTriggerExit(Collider collider) {
if (!Ignited && collider.gameObject.layer == LayerMask.NameToLayer("Fire")) {
BurningSourceCount--;
if (BurningSourceCount == 0) {
IgnitionStartTime = -1;
}
}
}
}

View File

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

View File

@ -17,7 +17,7 @@ PhysicsManager:
m_ClothInterCollisionDistance: 0 m_ClothInterCollisionDistance: 0
m_ClothInterCollisionStiffness: 0 m_ClothInterCollisionStiffness: 0
m_ContactsGeneration: 1 m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffeefeffffeefeffffeefeffffffffffffeefeffffeefeffffffffffffffffffc801feffffeefeffffe6fefffffafeffc818feffffeefeffffeefeffffeefeffc800ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_LayerCollisionMatrix: ffeefcffffeefcffffeefcffffffffffffeefcffffeefcffffffffffffffffffc801fcffffeefcffffe6fefffffafcffc818fcffffeefcffffeefcffffeefcffc800fdffc804feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1 m_AutoSimulation: 1
m_AutoSyncTransforms: 0 m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1 m_ReuseCollisionCallbacks: 1

View File

@ -26,7 +26,7 @@ TagManager:
- Hand - Hand
- Ground - Ground
- Teleport - Teleport
- - Fire
- -
- -
- -