R1
This commit is contained in:
parent
37252a4edc
commit
19ab6f65e3
258 changed files with 406592 additions and 0 deletions
23
Assets/Scripts/Global.cs
Normal file
23
Assets/Scripts/Global.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class Global
|
||||
{
|
||||
public static PlayerScript player;
|
||||
|
||||
public static void Dead ()
|
||||
{
|
||||
if (PlayerPrefs.HasKey("best_score"))
|
||||
{
|
||||
if (player.GetScore() > PlayerPrefs.GetInt("best_score")) PlayerPrefs.SetInt("best_score", player.GetScore());
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerPrefs.SetInt("best_score", player.GetScore());
|
||||
}
|
||||
|
||||
PlayerPrefs.SetInt("previous_score", player.GetScore());
|
||||
|
||||
SceneManager.LoadScene(2);
|
||||
}
|
||||
}
|
Reference in a new issue