using UnityEngine; /// /// This class detecs when the level(Location) ends /// public class LevelEnd : MonoBehaviour { public LoadEvent onLevelEnd; public GameScene[] locationsToLoad; public bool showLoadScreen; private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { onLevelEnd.Raise(locationsToLoad, showLoadScreen); } } }