Add you loos if you die

This commit is contained in:
Kotrba Filip
2020-02-02 13:30:06 +01:00
parent 4f3cd0d48e
commit 917cf6c4da
4 changed files with 47 additions and 4 deletions

View File

@@ -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;
}