using System; using UnityEngine; public class MapEntrance : MonoBehaviour { public Map mapToEnter; public int exitIndex; public void EnterMap() { LevelSwitcher.instance.LoadMap(mapToEnter, exitIndex); } private void OnTriggerEnter2D(Collider2D other) { //fade to black EnterMap(); } }