24 lines
498 B
C#
24 lines
498 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace Scampz.GameJam
|
|
{
|
|
public class LoadScene : MonoBehaviour
|
|
{
|
|
private bool loaded = false;
|
|
[SerializeField]
|
|
private string scene;
|
|
[SerializeField]
|
|
private Transform _spawnPoint;
|
|
|
|
void OnTriggerEnter(Collider collider)
|
|
{
|
|
if (!loaded && collider.CompareTag("Player"))
|
|
{
|
|
loaded = true;
|
|
GameManager.Instance.LoadScene(scene, _spawnPoint, LoadSceneMode.Single);
|
|
}
|
|
}
|
|
}
|
|
}
|