Merge branch 'master' of git.teascade.net:Saltosion/campfire
This commit is contained in:
commit
1a70bcc3d5
8
Assets/Audio Mixers.meta
Normal file
8
Assets/Audio Mixers.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8fb8780a85770846b14b024d4bf1c29
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
248
Assets/Audio Mixers/MainMixer.mixer
Normal file
248
Assets/Audio Mixers/MainMixer.mixer
Normal file
@ -0,0 +1,248 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!244 &-6119931374106344343
|
||||
AudioMixerEffectController:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_EffectID: 86b1dc2b2b693394caad6dfdf7d2acdd
|
||||
m_EffectName: Attenuation
|
||||
m_MixLevel: 6520c254fe97e8d4585afad68d351162
|
||||
m_Parameters: []
|
||||
m_SendTarget: {fileID: 0}
|
||||
m_EnableWetMix: 0
|
||||
m_Bypass: 0
|
||||
--- !u!243 &-6009061206453669325
|
||||
AudioMixerGroupController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Gameplay
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_GroupID: 01ed36fd4259f874d8e152aa9f5cbdb4
|
||||
m_Children:
|
||||
- {fileID: -267709887311468707}
|
||||
- {fileID: -2967980135314984734}
|
||||
- {fileID: 586271417499195193}
|
||||
m_Volume: 3b873ffd7476b574ab79c605a05a50ff
|
||||
m_Pitch: db09271ae0508dd4fab1979ce5ca6572
|
||||
m_Send: 00000000000000000000000000000000
|
||||
m_Effects:
|
||||
- {fileID: -6119931374106344343}
|
||||
m_UserColorIndex: 0
|
||||
m_Mute: 0
|
||||
m_Solo: 0
|
||||
m_BypassEffects: 0
|
||||
--- !u!245 &-3105936107480203619
|
||||
AudioMixerSnapshotController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Playing
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_SnapshotID: ac9cc10b0c59e3b4682dc5089372ae81
|
||||
m_FloatValues:
|
||||
3b873ffd7476b574ab79c605a05a50ff: 0
|
||||
m_TransitionOverrides: {}
|
||||
--- !u!243 &-2967980135314984734
|
||||
AudioMixerGroupController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Ambient
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_GroupID: ecc30646201221445ab5a1cd672c78d8
|
||||
m_Children: []
|
||||
m_Volume: f61e9e8888930534e91c19809f219fe6
|
||||
m_Pitch: 0d5d3def77582e44081f3b36f180a38e
|
||||
m_Send: 00000000000000000000000000000000
|
||||
m_Effects:
|
||||
- {fileID: 3581666672454972537}
|
||||
m_UserColorIndex: 0
|
||||
m_Mute: 0
|
||||
m_Solo: 0
|
||||
m_BypassEffects: 0
|
||||
--- !u!245 &-815558828361742615
|
||||
AudioMixerSnapshotController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: GameOver
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_SnapshotID: dd433c999a0f1de4b8d7ae8353027f93
|
||||
m_FloatValues:
|
||||
3b873ffd7476b574ab79c605a05a50ff: -60
|
||||
m_TransitionOverrides: {}
|
||||
--- !u!243 &-267709887311468707
|
||||
AudioMixerGroupController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Effects
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_GroupID: 1bdb8c14a13a7064e887fd8c05bd43e7
|
||||
m_Children: []
|
||||
m_Volume: fd01f6bdeaa870c4688fa6fcad7c3e41
|
||||
m_Pitch: fc8fd2fca838b3843a92c252855b9146
|
||||
m_Send: 00000000000000000000000000000000
|
||||
m_Effects:
|
||||
- {fileID: 1928862306469247254}
|
||||
m_UserColorIndex: 0
|
||||
m_Mute: 0
|
||||
m_Solo: 0
|
||||
m_BypassEffects: 0
|
||||
--- !u!241 &24100000
|
||||
AudioMixerController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: MainMixer
|
||||
m_OutputGroup: {fileID: 0}
|
||||
m_MasterGroup: {fileID: 24300002}
|
||||
m_Snapshots:
|
||||
- {fileID: 24500006}
|
||||
- {fileID: -3105936107480203619}
|
||||
- {fileID: 7009156351606643568}
|
||||
- {fileID: -815558828361742615}
|
||||
m_StartSnapshot: {fileID: 24500006}
|
||||
m_SuspendThreshold: -80
|
||||
m_EnableSuspend: 1
|
||||
m_UpdateMode: 1
|
||||
m_ExposedParameters: []
|
||||
m_AudioMixerGroupViews:
|
||||
- guids:
|
||||
- cce571dfddcbc694fa5856a9866157f8
|
||||
- 1bdb8c14a13a7064e887fd8c05bd43e7
|
||||
- ecc30646201221445ab5a1cd672c78d8
|
||||
- 440e1443b72e9e449a0e30e04101552d
|
||||
- 01ed36fd4259f874d8e152aa9f5cbdb4
|
||||
name: View
|
||||
m_CurrentViewIndex: 0
|
||||
m_TargetSnapshot: {fileID: -3105936107480203619}
|
||||
--- !u!243 &24300002
|
||||
AudioMixerGroupController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Master
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_GroupID: cce571dfddcbc694fa5856a9866157f8
|
||||
m_Children:
|
||||
- {fileID: -6009061206453669325}
|
||||
m_Volume: 1dc5725402baaca40b189e10927dfd5f
|
||||
m_Pitch: 91120b7d67bf787459cb1cee82330d2f
|
||||
m_Send: 00000000000000000000000000000000
|
||||
m_Effects:
|
||||
- {fileID: 24400004}
|
||||
m_UserColorIndex: 0
|
||||
m_Mute: 0
|
||||
m_Solo: 0
|
||||
m_BypassEffects: 0
|
||||
--- !u!244 &24400004
|
||||
AudioMixerEffectController:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_EffectID: 95aa08715333fc74e91e4a6901af43c9
|
||||
m_EffectName: Attenuation
|
||||
m_MixLevel: cace4e66d83ecc741a96258498de0f03
|
||||
m_Parameters: []
|
||||
m_SendTarget: {fileID: 0}
|
||||
m_EnableWetMix: 0
|
||||
m_Bypass: 0
|
||||
--- !u!245 &24500006
|
||||
AudioMixerSnapshotController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Snapshot
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_SnapshotID: ff8dc610a6ec0d14cb32ecaf12b55eb7
|
||||
m_FloatValues: {}
|
||||
m_TransitionOverrides: {}
|
||||
--- !u!243 &586271417499195193
|
||||
AudioMixerGroupController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Footsteps
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_GroupID: 440e1443b72e9e449a0e30e04101552d
|
||||
m_Children: []
|
||||
m_Volume: fb57fa187cc2b4149a071e77ee9f3a45
|
||||
m_Pitch: 1af3136670aece3419669e966058f72f
|
||||
m_Send: 00000000000000000000000000000000
|
||||
m_Effects:
|
||||
- {fileID: 3705997264899357636}
|
||||
m_UserColorIndex: 0
|
||||
m_Mute: 0
|
||||
m_Solo: 0
|
||||
m_BypassEffects: 0
|
||||
--- !u!244 &1928862306469247254
|
||||
AudioMixerEffectController:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_EffectID: 416a3b5c8c21a954b84a41f15a72ed51
|
||||
m_EffectName: Attenuation
|
||||
m_MixLevel: 13a2ed3d53628044daade4ea1ce9a01d
|
||||
m_Parameters: []
|
||||
m_SendTarget: {fileID: 0}
|
||||
m_EnableWetMix: 0
|
||||
m_Bypass: 0
|
||||
--- !u!244 &3581666672454972537
|
||||
AudioMixerEffectController:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_EffectID: 911a860d63d95184dba352be20e7aa70
|
||||
m_EffectName: Attenuation
|
||||
m_MixLevel: 0ac97cd1e1e69a848afc443504c6972a
|
||||
m_Parameters: []
|
||||
m_SendTarget: {fileID: 0}
|
||||
m_EnableWetMix: 0
|
||||
m_Bypass: 0
|
||||
--- !u!244 &3705997264899357636
|
||||
AudioMixerEffectController:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_EffectID: ee37a0386013f8f4ba2dad6353996bc5
|
||||
m_EffectName: Attenuation
|
||||
m_MixLevel: 0cf2b5dd63c3f56419bf06fba4cd7fdf
|
||||
m_Parameters: []
|
||||
m_SendTarget: {fileID: 0}
|
||||
m_EnableWetMix: 0
|
||||
m_Bypass: 0
|
||||
--- !u!245 &7009156351606643568
|
||||
AudioMixerSnapshotController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Paused
|
||||
m_AudioMixer: {fileID: 24100000}
|
||||
m_SnapshotID: 99acc46f1b1d7c24b861966f8835044d
|
||||
m_FloatValues:
|
||||
fd01f6bdeaa870c4688fa6fcad7c3e41: 0
|
||||
3b873ffd7476b574ab79c605a05a50ff: 0
|
||||
m_TransitionOverrides: {}
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 864413d1d9f4399408ae9cedcef47307
|
||||
guid: 032de345950918c4e89684078c6a7213
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
8
Assets/Prefabs/Burnables.meta
Normal file
8
Assets/Prefabs/Burnables.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eccabbfccff5dd643a2f4ab95956d0b7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
16
Assets/Prefabs/Burnables/Stick Burn Quality.asset
Normal file
16
Assets/Prefabs/Burnables/Stick Burn Quality.asset
Normal file
@ -0,0 +1,16 @@
|
||||
%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: Stick Burn Quality
|
||||
m_EditorClassIdentifier:
|
||||
FuelValue: 10
|
||||
BurningSound: {fileID: 0}
|
8
Assets/Prefabs/Burnables/Stick Burn Quality.asset.meta
Normal file
8
Assets/Prefabs/Burnables/Stick Burn Quality.asset.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 273b9cf97d0c80e449f24a33a2d261d1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
171
Assets/Prefabs/Burnables/Stick.prefab
Normal file
171
Assets/Prefabs/Burnables/Stick.prefab
Normal file
@ -0,0 +1,171 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5145448032959125661
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3101902165573212776}
|
||||
- component: {fileID: 5080344277934357577}
|
||||
- component: {fileID: 8966079174287621822}
|
||||
- component: {fileID: 2134983512241497966}
|
||||
m_Layer: 10
|
||||
m_Name: Cylinder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3101902165573212776
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5145448032959125661}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.1, y: 0.2, z: 0.1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 9177655811231306216}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &5080344277934357577
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5145448032959125661}
|
||||
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &8966079174287621822
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5145448032959125661}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 80996928df7a0d847bbb7a283c52976b, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!65 &2134983512241497966
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5145448032959125661}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1.0000001, y: 2.0000005, z: 1.0000005}
|
||||
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940699}
|
||||
--- !u!1 &9177655811231306215
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9177655811231306216}
|
||||
- component: {fileID: 456025085184268836}
|
||||
- component: {fileID: 8167482766655706823}
|
||||
- component: {fileID: 2107507585819105735}
|
||||
m_Layer: 0
|
||||
m_Name: Stick
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &9177655811231306216
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9177655811231306215}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 2.296, y: 2, z: 0.147}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 3101902165573212776}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!54 &456025085184268836
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9177655811231306215}
|
||||
serializedVersion: 2
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 1
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &8167482766655706823
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9177655811231306215}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f70b810850590804092bb2c772ea6012, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Grabbed: 0
|
||||
--- !u!114 &2107507585819105735
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9177655811231306215}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b647d1ea5d6785a4d8e6f6b2208e5f1c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Quality: {fileID: 11400000, guid: 273b9cf97d0c80e449f24a33a2d261d1, type: 2}
|
7
Assets/Prefabs/Burnables/Stick.prefab.meta
Normal file
7
Assets/Prefabs/Burnables/Stick.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46cbe90ffaf140c4990d7e0232834b91
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,5 +1,35 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4063427199230185944
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8433165236288212749}
|
||||
m_Layer: 11
|
||||
m_Name: Item Holder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8433165236288212749
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4063427199230185944}
|
||||
m_LocalRotation: {x: -0.17101014, y: -0.17101014, z: -0.030153712, w: 0.96984625}
|
||||
m_LocalPosition: {x: 0.3, y: -0.3, z: 1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6125707628839966534}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: -20, y: -20, z: 0}
|
||||
--- !u!1 &6125707628839966531
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -12,7 +42,7 @@ GameObject:
|
||||
- component: {fileID: 6125707628839966529}
|
||||
- component: {fileID: 6125707628839966528}
|
||||
- component: {fileID: 6125707628839966535}
|
||||
m_Layer: 0
|
||||
m_Layer: 11
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
@ -29,7 +59,8 @@ Transform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1.5, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 8433165236288212749}
|
||||
m_Father: {fileID: 6125707630481988396}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -56,7 +87,7 @@ Camera:
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.1
|
||||
near clip plane: 0.05
|
||||
far clip plane: 200
|
||||
field of view: 75
|
||||
orthographic: 0
|
||||
@ -156,7 +187,8 @@ GameObject:
|
||||
- component: {fileID: 6125707630481988370}
|
||||
- component: {fileID: 6125707630481988397}
|
||||
- component: {fileID: 6125707630481988371}
|
||||
m_Layer: 0
|
||||
- component: {fileID: 7093134810128755097}
|
||||
m_Layer: 11
|
||||
m_Name: Player
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@ -190,6 +222,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: b656f92dbeaf1784786c317df80ca152, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
GameState: {fileID: 0}
|
||||
BodyTransform: {fileID: 6125707630481988396}
|
||||
HeadTransform: {fileID: 6125707628839966534}
|
||||
--- !u!114 &6125707630481988397
|
||||
@ -204,12 +237,14 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 6b513dcf57a19464b92ff712f770f105, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
MovementSpeed: 4
|
||||
MovementSpeed: 3
|
||||
JumpVelocity: 4
|
||||
SlideVelocity: 3
|
||||
JumpGracePeriod: 0.2
|
||||
Antislipperiness: 10
|
||||
Antislipperiness: 20
|
||||
AntislipperinessInAir: 3
|
||||
Grounded: 0
|
||||
GroundNormal: {x: 0, y: 0, z: 0}
|
||||
--- !u!143 &6125707630481988371
|
||||
CharacterController:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -222,9 +257,31 @@ CharacterController:
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Height: 1.8
|
||||
m_Radius: 0.25
|
||||
m_SlopeLimit: 45
|
||||
m_StepOffset: 0.3
|
||||
m_Radius: 0.1
|
||||
m_SlopeLimit: 30
|
||||
m_StepOffset: 0.05
|
||||
m_SkinWidth: 0.08
|
||||
m_MinMoveDistance: 0.001
|
||||
m_Center: {x: 0, y: 0.9, z: 0}
|
||||
--- !u!114 &7093134810128755097
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6125707630481988399}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8f679bace24150841865636642a63629, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
CameraTransform: {fileID: 6125707628839966534}
|
||||
HandTransform: {fileID: 8433165236288212749}
|
||||
GrabHint: {fileID: 0}
|
||||
GrabText: {fileID: 0}
|
||||
ItemLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1024
|
||||
Distance: 2
|
||||
ThrowVelocity: 6
|
||||
GrabbedItem: {fileID: 0}
|
||||
|
@ -12,7 +12,7 @@ GameObject:
|
||||
- component: {fileID: 5400695019851472734}
|
||||
- component: {fileID: 5400695019851472735}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_Name: Pause Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 72 KiB |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 44 KiB |
@ -1,104 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbe9964f930fcb64983ae1cf44fd4bce
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 1
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 3
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Win
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 2
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -73,7 +73,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c1cb7e9e120078f43bce4f0b1be547a7, type: 3}
|
||||
m_Name: AmbientOcclusion
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
active: 0
|
||||
enabled:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
@ -180,8 +180,8 @@ MonoBehaviour:
|
||||
overrideState: 0
|
||||
value: 0
|
||||
postExposure:
|
||||
overrideState: 1
|
||||
value: -1
|
||||
overrideState: 0
|
||||
value: 0
|
||||
contrast:
|
||||
overrideState: 0
|
||||
value: 0
|
||||
|
26
Assets/Scripts/AudioMaster.cs
Normal file
26
Assets/Scripts/AudioMaster.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class AudioMaster : MonoBehaviour {
|
||||
public GameState GameState;
|
||||
|
||||
public AudioMixer Mixer;
|
||||
public AudioMixerSnapshot PlayingSnapshot;
|
||||
public AudioMixerSnapshot PausedSnapshot;
|
||||
public AudioMixerSnapshot GameoverSnapshot;
|
||||
public float TransitionDuration;
|
||||
|
||||
void Update() {
|
||||
float[] Weights = {
|
||||
GameState.Current == State.Playing ? 1 : 0,
|
||||
GameState.Current == State.Paused ? 1 : 0,
|
||||
GameState.Current == State.GameOver ? 1 : 0,
|
||||
};
|
||||
AudioMixerSnapshot[] Snapshots = {
|
||||
PlayingSnapshot,
|
||||
PausedSnapshot,
|
||||
GameoverSnapshot,
|
||||
};
|
||||
Mixer.TransitionToSnapshots(Snapshots, Weights, TransitionDuration);
|
||||
}
|
||||
}
|
11
Assets/Scripts/AudioMaster.cs.meta
Normal file
11
Assets/Scripts/AudioMaster.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 499ed37d51869ba44bbe6f61ffe9688e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Scripts/BurnQuality.cs
Normal file
9
Assets/Scripts/BurnQuality.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "Unnamed Burn Quality", menuName = "Campfire/Burn Quality")]
|
||||
public class BurnQuality : ScriptableObject {
|
||||
public float FuelValue;
|
||||
public AudioClip BurningSound;
|
||||
}
|
11
Assets/Scripts/BurnQuality.cs.meta
Normal file
11
Assets/Scripts/BurnQuality.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89be129a0b3b303478d411ad4ec84e30
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
7
Assets/Scripts/Burnable.cs
Normal file
7
Assets/Scripts/Burnable.cs
Normal file
@ -0,0 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Burnable : MonoBehaviour {
|
||||
public BurnQuality Quality;
|
||||
}
|
11
Assets/Scripts/Burnable.cs.meta
Normal file
11
Assets/Scripts/Burnable.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b647d1ea5d6785a4d8e6f6b2208e5f1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraController : MonoBehaviour {
|
||||
public GameState GameState;
|
||||
public Transform BodyTransform;
|
||||
public Transform HeadTransform;
|
||||
|
||||
@ -13,10 +14,7 @@ public class CameraController : MonoBehaviour {
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
if (Menu.Paused) {
|
||||
Cursor.visible = true;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
} else {
|
||||
if (GameState.Current == State.Playing) {
|
||||
Cursor.visible = false;
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
|
||||
@ -33,6 +31,9 @@ public class CameraController : MonoBehaviour {
|
||||
Eulers.x = 270;
|
||||
}
|
||||
HeadTransform.localEulerAngles = Eulers;
|
||||
} else {
|
||||
Cursor.visible = true;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
84
Assets/Scripts/Campfire.cs
Normal file
84
Assets/Scripts/Campfire.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Campfire : MonoBehaviour {
|
||||
public GameState GameState;
|
||||
public Light DynamicLight;
|
||||
[Tooltip("This audiosource will play the clips to indicate that an object has been thrown in the fire.")]
|
||||
public AudioSource BurnEffectSource;
|
||||
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;
|
||||
public float RandomVarianceDuration;
|
||||
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("Runtime values")]
|
||||
public float Fuel;
|
||||
|
||||
private Color EnoughFuelColor;
|
||||
private float FullRange;
|
||||
|
||||
private float RandomVariance = 0;
|
||||
private float NextRandomVariance = 0;
|
||||
private float LastRandomVarianceChange = 0;
|
||||
|
||||
private List<Burnable> LogQueue = new List<Burnable>();
|
||||
private float LastLogBurned = 0;
|
||||
|
||||
private void Awake() {
|
||||
EnoughFuelColor = DynamicLight.color;
|
||||
FullRange = DynamicLight.range;
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
if (LogQueue.Count > 0 && Time.time - LastLogBurned > LogBurningCooldown) {
|
||||
LastLogBurned = Time.time;
|
||||
BurnLog(LogQueue[0]);
|
||||
LogQueue.RemoveAt(0);
|
||||
}
|
||||
|
||||
if (Time.time - LastRandomVarianceChange > RandomVarianceDuration) {
|
||||
NextRandomVariance = (Random.value - 0.5f) * 2f * RandomVarianceMagnitude;
|
||||
LastRandomVarianceChange = Time.time;
|
||||
}
|
||||
RandomVariance = Mathf.Lerp(RandomVariance, NextRandomVariance, (Time.time - LastRandomVarianceChange) / RandomVarianceDuration);
|
||||
|
||||
Fuel -= Time.deltaTime;
|
||||
DynamicLight.range = Mathf.Log(Fuel + 1f, 10) / 2f * FullRange + RandomVariance;
|
||||
DynamicLight.color = Color.Lerp(DynamicLight.color, Fuel < GoodFuelAmount ? TooLowFuelColor : EnoughFuelColor, 10f * Time.deltaTime);
|
||||
|
||||
if (Fuel <= 0) {
|
||||
GameState.Current = State.GameOver;
|
||||
}
|
||||
}
|
||||
|
||||
private void BurnLog(Burnable burnable) {
|
||||
Fuel += burnable.Quality.FuelValue;
|
||||
if (Fuel < GoodFuelAmount) {
|
||||
Fuel += 2;
|
||||
}
|
||||
BurnEffectSource.PlayOneShot(burnable.Quality.BurningSound);
|
||||
Destroy(burnable.gameObject);
|
||||
}
|
||||
|
||||
private void OnCollisionEnter(Collision c) {
|
||||
if (c.collider.attachedRigidbody != null && c.collider.attachedRigidbody) {
|
||||
Burnable Burnable = c.collider.attachedRigidbody.GetComponent<Burnable>();
|
||||
if (Burnable != null) {
|
||||
LogQueue.Add(Burnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCollisionExit(Collision c) {
|
||||
if (c.collider.attachedRigidbody != null && c.collider.attachedRigidbody) {
|
||||
Burnable Burnable = c.collider.attachedRigidbody.GetComponent<Burnable>();
|
||||
if (Burnable != null) {
|
||||
LogQueue.Remove(Burnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Campfire.cs.meta
Normal file
11
Assets/Scripts/Campfire.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d53e1b3547ca29043b4a527f784da518
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 100
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
27
Assets/Scripts/GameState.cs
Normal file
27
Assets/Scripts/GameState.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public enum State {
|
||||
Playing,
|
||||
Paused,
|
||||
GameOver
|
||||
}
|
||||
|
||||
public class GameState : MonoBehaviour {
|
||||
public State Current = State.Playing;
|
||||
|
||||
private void Update() {
|
||||
if (Input.GetKeyDown(KeyCode.Escape)) {
|
||||
switch (Current) {
|
||||
case State.Playing:
|
||||
Current = State.Paused;
|
||||
break;
|
||||
case State.Paused:
|
||||
Current = State.Playing;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Time.timeScale = Mathf.Lerp(Time.timeScale, Current == State.Paused ? 0 : 1, 10f * Time.unscaledDeltaTime);
|
||||
}
|
||||
}
|
11
Assets/Scripts/GameState.cs.meta
Normal file
11
Assets/Scripts/GameState.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea392b45677427546a64c81b04afbc11
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
49
Assets/Scripts/Item.cs
Normal file
49
Assets/Scripts/Item.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(Rigidbody))]
|
||||
public class Item : MonoBehaviour {
|
||||
[Header("Runtime values")]
|
||||
public bool Grabbed = false;
|
||||
|
||||
private Rigidbody Body;
|
||||
private Transform World;
|
||||
private bool BeingPlaced = false;
|
||||
private Vector3 TargetPosition;
|
||||
|
||||
private void Awake() {
|
||||
Body = GetComponent<Rigidbody>();
|
||||
World = GameObject.FindGameObjectWithTag("World").transform;
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
if (Grabbed) {
|
||||
transform.localPosition = Vector3.Lerp(transform.localPosition, Vector3.zero, 10f * Time.deltaTime);
|
||||
} else if (BeingPlaced) {
|
||||
// Lerp to TargetPosition, then continue simulation
|
||||
Vector3 Delta = TargetPosition - transform.position;
|
||||
float Diff = Delta.magnitude;
|
||||
if (Diff < 0.1f) {
|
||||
transform.position = TargetPosition;
|
||||
Body.isKinematic = false;
|
||||
BeingPlaced = false;
|
||||
} else {
|
||||
transform.position = Vector3.Lerp(transform.position, TargetPosition, 20f * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void PickUp(Transform handTransform) {
|
||||
transform.parent = handTransform;
|
||||
Body.isKinematic = true;
|
||||
Grabbed = true;
|
||||
}
|
||||
|
||||
public void Drop(Vector3 where) {
|
||||
transform.parent = World;
|
||||
TargetPosition = where;
|
||||
BeingPlaced = true;
|
||||
Grabbed = false;
|
||||
}
|
||||
}
|
11
Assets/Scripts/Item.cs.meta
Normal file
11
Assets/Scripts/Item.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f70b810850590804092bb2c772ea6012
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
61
Assets/Scripts/ItemGrabber.cs
Normal file
61
Assets/Scripts/ItemGrabber.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ItemGrabber : MonoBehaviour {
|
||||
public Transform CameraTransform;
|
||||
public Transform HandTransform;
|
||||
public CanvasGroup GrabHint;
|
||||
public Text GrabText;
|
||||
public LayerMask ItemLayer;
|
||||
public float Distance;
|
||||
public float ThrowVelocity;
|
||||
|
||||
[Header("Runtime values")]
|
||||
public Item GrabbedItem;
|
||||
|
||||
private void Awake() {
|
||||
if (GrabHint == null) {
|
||||
Debug.LogWarning("Player's GrabHint is not set, and pick ups will not be indicated.");
|
||||
}
|
||||
if (GrabText == null) {
|
||||
Debug.LogWarning("Player's GrabText is not set, and pick up texts will not necessarily match the object.");
|
||||
}
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
Item Item = null;
|
||||
RaycastHit Hit;
|
||||
Vector3 From = CameraTransform.position;
|
||||
Vector3 Direction = CameraTransform.forward;
|
||||
if (GrabbedItem == null) {
|
||||
Debug.DrawLine(From, From + Direction * Distance, Color.red);
|
||||
if (Physics.Raycast(From, Direction, out Hit, Distance, ItemLayer) &&
|
||||
Hit.collider.attachedRigidbody != null) {
|
||||
Item = Hit.collider.attachedRigidbody.GetComponent<Item>();
|
||||
}
|
||||
|
||||
if (Item != null && Input.GetButtonDown("Grab")) {
|
||||
Item.PickUp(HandTransform);
|
||||
GrabbedItem = Item;
|
||||
}
|
||||
} else if (Input.GetButtonDown("Grab")) {
|
||||
Vector3 DropPosition;
|
||||
if (Physics.Raycast(From, Direction, out Hit, Distance * 2f)) {
|
||||
DropPosition = Hit.point + Hit.normal * 0.1f;
|
||||
} else {
|
||||
DropPosition = From + Direction * Distance;
|
||||
}
|
||||
GrabbedItem.Drop(DropPosition);
|
||||
GrabbedItem = null;
|
||||
}
|
||||
|
||||
if (GrabHint != null) {
|
||||
GrabHint.alpha = Mathf.Lerp(GrabHint.alpha, Item != null ? 1 : 0, 10f * Time.deltaTime);
|
||||
}
|
||||
if (Item != null && GrabText != null) {
|
||||
GrabText.text = $"Take {Item.name}";
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/ItemGrabber.cs.meta
Normal file
11
Assets/Scripts/ItemGrabber.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f679bace24150841865636642a63629
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -2,20 +2,21 @@
|
||||
|
||||
[RequireComponent(typeof(CanvasGroup))]
|
||||
public class PauseMenu : MonoBehaviour {
|
||||
public bool Paused = false;
|
||||
public GameState GameState;
|
||||
|
||||
private CanvasGroup Canvas;
|
||||
private bool Paused {
|
||||
get {
|
||||
return GameState.Current == State.Paused;
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake() {
|
||||
Canvas = GetComponent<CanvasGroup>();
|
||||
Canvas.alpha = Paused ? 1 : 0;
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
if (Input.GetKeyDown(KeyCode.Escape)) {
|
||||
Paused = !Paused;
|
||||
}
|
||||
|
||||
Time.timeScale = Mathf.Lerp(Time.timeScale, Paused ? 0 : 1, 10f * Time.unscaledDeltaTime);
|
||||
Canvas.alpha = Mathf.Lerp(Canvas.alpha, Paused ? 1 : 0, 10f * Time.unscaledDeltaTime);
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ using UnityEngine;
|
||||
public class PlayerController : MonoBehaviour {
|
||||
public float MovementSpeed;
|
||||
public float JumpVelocity;
|
||||
public float SlideVelocity;
|
||||
[Tooltip("How long after falling off a ledge can the player still jump?")]
|
||||
public float JumpGracePeriod;
|
||||
[Tooltip("Lower values make the movement feel floatier.")]
|
||||
@ -15,12 +16,14 @@ public class PlayerController : MonoBehaviour {
|
||||
|
||||
[Header("Runtime values")]
|
||||
public bool Grounded;
|
||||
public Vector3 GroundNormal;
|
||||
|
||||
private CharacterController Character;
|
||||
|
||||
private Vector3 GroundVelocity = new Vector3();
|
||||
private float FallingVelocity;
|
||||
private float LastGroundedTime;
|
||||
private float SlideStartTime;
|
||||
|
||||
private void Awake() {
|
||||
Character = GetComponent<CharacterController>();
|
||||
@ -32,8 +35,14 @@ public class PlayerController : MonoBehaviour {
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
Vector3 CurrentVelocity = new Vector3();
|
||||
GroundNormal = RaycastGroundNormal();
|
||||
|
||||
// Sliding
|
||||
bool Sliding = Grounded && Vector3.Angle(GroundNormal, Vector3.up) > Character.slopeLimit;
|
||||
|
||||
// Groundedness stuff and gravity
|
||||
if (Character.isGrounded) {
|
||||
if (Character.isGrounded && !Sliding) {
|
||||
FallingVelocity = Mathf.Max(0, FallingVelocity);
|
||||
LastGroundedTime = Time.time;
|
||||
} else {
|
||||
@ -46,6 +55,7 @@ public class PlayerController : MonoBehaviour {
|
||||
FallingVelocity = JumpVelocity;
|
||||
Grounded = false;
|
||||
}
|
||||
CurrentVelocity += FallingVelocity * Vector3.up;
|
||||
|
||||
float SlippyFactor = Grounded ? Antislipperiness : AntislipperinessInAir;
|
||||
|
||||
@ -57,13 +67,40 @@ public class PlayerController : MonoBehaviour {
|
||||
// Add player input momentum
|
||||
float TargetSpeed = MovementSpeed; // Tweak this to enable running or stuff
|
||||
Vector3 Move = transform.forward * Input.GetAxis("Vertical") + transform.right * Input.GetAxis("Horizontal");
|
||||
// If Move magnitude is < 0, it's probably an analog stick, so scale target speed accordingly.
|
||||
TargetSpeed *= Mathf.Min(1, Move.magnitude);
|
||||
|
||||
if (Move.magnitude > 0) {
|
||||
Move.Normalize();
|
||||
if (Grounded) {
|
||||
// Slow down when moving on slopes
|
||||
TargetSpeed *= Vector3.Dot(Vector3.up, GroundNormal);
|
||||
}
|
||||
float CurrentSpeed = Vector3.Dot(Move, GroundVelocity);
|
||||
float SpeedDiff = TargetSpeed - CurrentSpeed;
|
||||
float Acceleration = Mathf.Min(SpeedDiff, TargetSpeed * SlippyFactor * Time.deltaTime);
|
||||
GroundVelocity += Move * Acceleration;
|
||||
}
|
||||
CurrentVelocity += GroundVelocity;
|
||||
|
||||
Character.Move((GroundVelocity + FallingVelocity * Vector3.up) * Time.deltaTime);
|
||||
// Sliiide
|
||||
if (Sliding) {
|
||||
CurrentVelocity = Vector3.ProjectOnPlane(CurrentVelocity, GroundNormal);
|
||||
CurrentVelocity += Vector3.ProjectOnPlane(-Vector3.up, GroundNormal) * SlideVelocity;
|
||||
}
|
||||
|
||||
Character.Move(CurrentVelocity * Time.deltaTime);
|
||||
}
|
||||
|
||||
private Vector3 RaycastGroundNormal() {
|
||||
RaycastHit Hit;
|
||||
if (Physics.CapsuleCast(
|
||||
transform.position + Vector3.up * Character.radius,
|
||||
transform.position + Vector3.up * (Character.height - Character.radius),
|
||||
Character.radius, -Vector3.up, out Hit, Character.skinWidth * 2)) {
|
||||
return Hit.normal;
|
||||
} else {
|
||||
return Vector3.up;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ Material:
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _Exposure: 0.6
|
||||
- _Exposure: 0.5
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
|
@ -3,7 +3,7 @@
|
||||
--- !u!55 &1
|
||||
PhysicsManager:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
serializedVersion: 13
|
||||
m_Gravity: {x: 0, y: -9.81, z: 0}
|
||||
m_DefaultMaterial: {fileID: 0}
|
||||
m_BounceThreshold: 2
|
||||
@ -17,11 +17,12 @@ PhysicsManager:
|
||||
m_ClothInterCollisionDistance: 0
|
||||
m_ClothInterCollisionStiffness: 0
|
||||
m_ContactsGeneration: 1
|
||||
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
m_LayerCollisionMatrix: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
m_AutoSimulation: 1
|
||||
m_AutoSyncTransforms: 0
|
||||
m_ReuseCollisionCallbacks: 1
|
||||
m_ClothInterCollisionSettingsToggle: 0
|
||||
m_ClothGravity: {x: 0, y: -9.81, z: 0}
|
||||
m_ContactPairsMode: 0
|
||||
m_BroadphaseType: 0
|
||||
m_WorldBounds:
|
||||
@ -31,4 +32,5 @@ PhysicsManager:
|
||||
m_FrictionType: 0
|
||||
m_EnableEnhancedDeterminism: 0
|
||||
m_EnableUnifiedHeightmaps: 1
|
||||
m_DefaultMaxAngluarSpeed: 7
|
||||
m_SolverType: 0
|
||||
m_DefaultMaxAngularSpeed: 7
|
||||
|
@ -38,7 +38,7 @@ InputManager:
|
||||
axis: 0
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire1
|
||||
m_Name: Grab
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
@ -182,7 +182,7 @@ InputManager:
|
||||
axis: 1
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: Fire1
|
||||
m_Name: Grab
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
|
@ -5,6 +5,7 @@ TagManager:
|
||||
serializedVersion: 2
|
||||
tags:
|
||||
- Pause Menu
|
||||
- World
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
@ -16,8 +17,8 @@ TagManager:
|
||||
-
|
||||
- Post-Processing
|
||||
- Campfire
|
||||
-
|
||||
-
|
||||
- Item
|
||||
- Player
|
||||
-
|
||||
-
|
||||
-
|
||||
|
Loading…
Reference in New Issue
Block a user