2025-04-18 15:54:50 -04:00
|
|
|
using UnityEngine;
|
|
|
|
|
using Game;
|
|
|
|
|
using Music;
|
|
|
|
|
using Player;
|
2025-03-03 18:23:54 -05:00
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
2025-04-18 15:54:50 -04:00
|
|
|
namespace Game
|
2025-03-03 18:23:54 -05:00
|
|
|
{
|
2025-04-18 15:54:50 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// This class manages the map selection process by setting the selected map
|
|
|
|
|
/// based on the active toggle in the toggle group.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class MapSelect : MonoBehaviour
|
2025-03-03 18:23:54 -05:00
|
|
|
{
|
2025-04-18 15:54:50 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// The toggle group containing the map selection toggles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private ToggleGroup maps;
|
2025-03-03 18:23:54 -05:00
|
|
|
|
2025-04-18 15:54:50 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes the toggle group for map selection.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
|
|
|
|
maps = GetComponent<ToggleGroup>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the selected map in the game manager based on the active toggle.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
|
|
|
|
// Get the currently active toggle and set the selected map
|
|
|
|
|
Toggle toggle = maps.GetFirstActiveToggle();
|
|
|
|
|
GameManager.map = toggle.name;
|
|
|
|
|
}
|
2025-03-03 18:23:54 -05:00
|
|
|
}
|
2025-04-16 19:57:54 -04:00
|
|
|
}
|