Files
Crash-Course/Assets/Scripts/Game/MapSelect.cs
2025-03-28 17:39:07 -04:00

19 lines
365 B
C#

using UnityEngine;
using UnityEngine.UI;
public class MapSelect : MonoBehaviour
{
private ToggleGroup maps;
private void Start()
{
maps = GetComponent<ToggleGroup>();
}
void Update() // Sets the map based on the selected toggle
{
Toggle toggle = maps.GetFirstActiveToggle();
GameManager.map = toggle.name;
}
}