1
0
Fork 0
This commit is contained in:
Florian RICHER (MrDev023) 2019-01-27 14:54:55 +01:00
parent 37252a4edc
commit 19ab6f65e3
258 changed files with 406592 additions and 0 deletions

23
Assets/Scripts/Global.cs Normal file
View 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);
}
}