This code switches between maps, just switch inputs as you wish. I used (InputGetKeyDown).
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mapswitcher : MonoBehaviour {
public GameObject map1, map2;
// Start is called before the first frame update
void Awake()
{
map1.SetActive(true);
map2.SetActive(false);
}
// Update is called once per frame
void Update()
{
// Input.GetButtonDown("Mapswitch")
if (Input.GetKeyDown("e"))
{
map1.SetActive(!map1.activeInHierarchy);
map2.SetActive(!map2.activeInHierarchy);
}
}
}