Advertisement
Guest User

Game Manager

a guest
Oct 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3.  
  4. public class GameManager : MonoBehaviour
  5. {
  6. public static GameManager instance = null;
  7.  
  8. [SerializeField] private Text balanceText;
  9.  
  10. public static int balance;
  11.  
  12. private void Awake()
  13. {
  14. if (instance == null)
  15. instance = this;
  16. else if (instance != this)
  17. Destroy(gameObject);
  18. }
  19.  
  20. private void Update()
  21. {
  22. balanceText.text = balance.ToString();
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement