1
0
Fork 0
This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
Global-Game-Jam-2019/Assets/Scripts/Global.cs
2019-01-27 14:54:55 +01:00

23 lines
No EOL
553 B
C#

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