MapSet (Multiple maps)
Localization explanation in MapSet
Last updated
Localization explanation in MapSet
Last updated
using MultiSet;
using UnityEngine;
using UnityEngine.UI;
public class MapSetCodeUpdater : MonoBehaviour
{
// Reference to the Map Localization Manager
private MapLocalizationManager mapLocalizationManager;
// Input field to get the new Map ID from the user
[SerializeField]
private InputField mapCodeInputField;
void Start()
{
// Find the Map Localization Manager component in the scene
mapLocalizationManager = FindObjectOfType<MapLocalizationManager>();
if (mapLocalizationManager == null)
{
Debug.LogError("MapLocalizationManager not found! Please ensure it is added to the scene.");
}
if (mapCodeInputField == null)
{
Debug.LogError("InputField reference is missing! Please assign it in the inspector.");
}
mapLocalizationManager.localizationType = LocalizationType.Mapset;
}
// Method to update the Map ID
public void UpdateMapId()
{
if (mapLocalizationManager != null && mapCodeInputField != null)
{
string newMapCode = mapCodeInputField.text;
if (!string.IsNullOrWhiteSpace(newMapCode))
{
mapLocalizationManager.mapOrMapsetCode = newMapCode;
Debug.Log($"Map Code updated to: {newMapCode}");
}
else
{
Debug.LogWarning("Map Code cannot be empty! Please enter a valid Code.");
}
}
}
}