Add you loos if you die
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user