From 917cf6c4da3d40f5992396257e9f043f136bcca5 Mon Sep 17 00:00:00 2001 From: Kotrba Filip Date: Sun, 2 Feb 2020 13:30:06 +0100 Subject: [PATCH] Add you loos if you die --- Assets/Prefabs/Weapon_1.prefab | 2 +- Assets/Prefabs/Weapon_3.prefab | 2 +- Assets/Scenes/PlayScene.unity | 37 +++++++++++++++++++++++++++++++++ Assets/Scripts/PlayerManager.cs | 10 +++++++-- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Assets/Prefabs/Weapon_1.prefab b/Assets/Prefabs/Weapon_1.prefab index 7228237..e20200c 100644 --- a/Assets/Prefabs/Weapon_1.prefab +++ b/Assets/Prefabs/Weapon_1.prefab @@ -80,7 +80,7 @@ AudioSource: SpatializePostEffects: 0 Priority: 128 DopplerLevel: 1 - MinDistance: 1 + MinDistance: 1.705212 MaxDistance: 500 Pan2D: 0 rolloffMode: 0 diff --git a/Assets/Prefabs/Weapon_3.prefab b/Assets/Prefabs/Weapon_3.prefab index 87df254..997206f 100644 --- a/Assets/Prefabs/Weapon_3.prefab +++ b/Assets/Prefabs/Weapon_3.prefab @@ -203,7 +203,7 @@ AudioSource: SpatializePostEffects: 0 Priority: 128 DopplerLevel: 1 - MinDistance: 1 + MinDistance: 2.4825754 MaxDistance: 500 Pan2D: 0 rolloffMode: 0 diff --git a/Assets/Scenes/PlayScene.unity b/Assets/Scenes/PlayScene.unity index 1fd6115..0bd3f77 100644 --- a/Assets/Scenes/PlayScene.unity +++ b/Assets/Scenes/PlayScene.unity @@ -1579,6 +1579,12 @@ RectTransform: m_AnchoredPosition: {x: 40, y: 40} m_SizeDelta: {x: 150, y: 150} m_Pivot: {x: 0, y: 0} +--- !u!82 &824965140 stripped +AudioSource: + m_CorrespondingSourceObject: {fileID: 5981860502065413816, guid: 204c7411afdd01a478b1a1e25607d50c, + type: 3} + m_PrefabInstance: {fileID: 7985979212702423926} + m_PrefabAsset: {fileID: 0} --- !u!1 &863154877 GameObject: m_ObjectHideFlags: 0 @@ -9328,11 +9334,37 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 532783939, guid: 204c7411afdd01a478b1a1e25607d50c, type: 3} + propertyPath: MinDistance + value: 3.2005157 + objectReference: {fileID: 0} + - target: {fileID: 532783939, guid: 204c7411afdd01a478b1a1e25607d50c, type: 3} + propertyPath: m_Volume + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 532783939, guid: 204c7411afdd01a478b1a1e25607d50c, type: 3} + propertyPath: Priority + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 532783939, guid: 204c7411afdd01a478b1a1e25607d50c, type: 3} + propertyPath: panLevelCustomCurve.m_Curve.Array.data[0].value + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4607742650766078089, guid: 204c7411afdd01a478b1a1e25607d50c, type: 3} propertyPath: Sun value: objectReference: {fileID: 1345459422} + - target: {fileID: 5981860502065413816, guid: 204c7411afdd01a478b1a1e25607d50c, + type: 3} + propertyPath: m_Volume + value: 0.08 + objectReference: {fileID: 0} + - target: {fileID: 6900128296167351179, guid: 204c7411afdd01a478b1a1e25607d50c, + type: 3} + propertyPath: m_LocalPosition.y + value: 1.796 + objectReference: {fileID: 0} - target: {fileID: 7985979212931499537, guid: 204c7411afdd01a478b1a1e25607d50c, type: 3} propertyPath: m_Name @@ -9343,6 +9375,11 @@ PrefabInstance: propertyPath: guiManager value: objectReference: {fileID: 587476774} + - target: {fileID: 7985979212931499548, guid: 204c7411afdd01a478b1a1e25607d50c, + type: 3} + propertyPath: audio + value: + objectReference: {fileID: 824965140} - target: {fileID: 7985979212931499549, guid: 204c7411afdd01a478b1a1e25607d50c, type: 3} propertyPath: m_LocalPosition.x diff --git a/Assets/Scripts/PlayerManager.cs b/Assets/Scripts/PlayerManager.cs index c229b03..40ef7fc 100644 --- a/Assets/Scripts/PlayerManager.cs +++ b/Assets/Scripts/PlayerManager.cs @@ -30,8 +30,8 @@ public class PlayerManager : MonoBehaviour private float selectTime = 1; public AudioSource audio; public AudioClip lose; - private float nextMapeTime = 2; - private float nextMapeTime2 = 2; + private float nextMapeTime = 3; + private float nextMapeTime2 = 3; // Start is called before the first frame update @@ -64,6 +64,12 @@ public class PlayerManager : MonoBehaviour { if (audio != null && lose != null && (nextMapeTime2 + 1) <= Time.time) { + playerCamera.transform.parent = null; + rigidBody.freezeRotation = true; + speed = 0; + runSpeed = 0; + audio.Stop(); + audio.volume = 0.5f; audio.PlayOneShot(lose); nextMapeTime2 = nextMapeTime + Time.time; }