Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PermanentUI : MonoBehaviour
- {
- public int cherries = 0;
- public int cherriesLastLevel;
- public int lives = 3;
- public int level = 0;
- public TextMeshProUGUI cherryText;
- public TextMeshProUGUI livesText;
- public static PermanentUI permanent;
- public void Start()
- {
- DontDestroyOnLoad(gameObject);
- // Singleton Pattern
- if (!permanent)
- {
- permanent = this;
- }
- else
- {
- Destroy(gameObject);
- }
- }
- public void SavePlayer()
- {
- SaveSystem.SavePlayer(this);
- }
- public void Reset()
- {
- cherries = cherriesLastLevel;
- cherryText.text = cherries.ToString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement