using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class endTrigger : MonoBehaviour { private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { SceneManager.LoadScene("end"); SceneManager.UnloadSceneAsync("game"); } } }