Advertisement
johnnygoodguy2000

DeathMenu.cs

Apr 14th, 2024 (edited)
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | Gaming | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement; // Add this line for SceneManager
  5.  
  6. public class DeathMenu : MonoBehaviour
  7. {
  8.     public string mainMenuLevel;
  9.  
  10.     public void RestartGame()
  11.     {
  12.         FindAnyObjectByType<GameManager>().Reset();
  13.        // GameManager.instance.RestartGame();
  14.     }
  15.  
  16.     public void QuitToMain()
  17.     {
  18.         SceneManager.LoadScene(mainMenuLevel); // Replace Application.LoadLevel with SceneManager.LoadScene
  19.     }
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement