GameManage.cs 723 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class GameManage : MonoBehaviour
  6. {
  7. private static GameManage instance;
  8. public static GameManage Instance
  9. {
  10. get
  11. {
  12. return instance;
  13. }
  14. }
  15. public GameObject overPanel;
  16. public GameObject player;
  17. // Use this for initialization
  18. void Start()
  19. {
  20. instance = this;
  21. }
  22. // Update is called once per frame
  23. void Update()
  24. {
  25. }
  26. public void ResetGame()
  27. {
  28. SceneManager.LoadScene("main");
  29. }
  30. public void GameOver()
  31. {
  32. overPanel.SetActive(true);
  33. Destroy(player);
  34. }
  35. }