continuing with combat, sword combos working, not finished, blockign working, need to build blockpush and improving bow combat
This commit is contained in:
39
Assets/Scripts/MainMenuManager.cs
Normal file
39
Assets/Scripts/MainMenuManager.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class MainMenuManager : MonoBehaviour
|
||||
{
|
||||
[Header("Scene Settings")]
|
||||
[Tooltip("The exact name of the scene you want to load when starting a new game (e.g. 'Level1' or 'WorldMap').")]
|
||||
public string newGameSceneName = "Level1";
|
||||
|
||||
/// <summary>
|
||||
/// Call this method from the 'On Click ()' event of your Start Game Button.
|
||||
/// </summary>
|
||||
public void StartNewGame()
|
||||
{
|
||||
Debug.Log($"[MainMenuManager] Handing off to LevelLoader for: {newGameSceneName}...");
|
||||
|
||||
// Pass the request to our global LevelLoader which will handle the loading screen!
|
||||
LevelLoader.LoadLevel(newGameSceneName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this method from the 'On Click ()' event of your Quit or Exit Button.
|
||||
/// </summary>
|
||||
public void ExitToDesktop()
|
||||
{
|
||||
Debug.Log("[MainMenuManager] Exiting to Desktop...");
|
||||
|
||||
// This closes the actual built game executable (.exe)
|
||||
Application.Quit();
|
||||
|
||||
// If you are testing this inside the Unity Editor, Application.Quit() does nothing.
|
||||
// This preprocessor directive forcefully stops Play Mode so you can still test the quit button!
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorApplication.isPlaying = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user