TheMuseumProject/Assets/Scripts/Level/TriggerLevelChange.cs

12 lines
270 B
C#
Raw Normal View History

using UnityEngine;
using UnityEngine.SceneManagement;
public class TriggerLevelChange : MonoBehaviour
{
public string levelToLoad;
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Player") SceneManager.LoadScene(levelToLoad);
}
}