lost me mind i did
This commit is contained in:
23
Assets/Scripts/SceneManagement/LoadScene.cs
Normal file
23
Assets/Scripts/SceneManagement/LoadScene.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user