2023-05-30 20:40:18 +02:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
public class ChangeScene : MonoBehaviour
|
|
|
|
{
|
2023-06-11 23:33:34 +02:00
|
|
|
public string SceneName;
|
|
|
|
|
2023-05-30 20:40:18 +02:00
|
|
|
public Scene changeTo;
|
|
|
|
// Start is called before the first frame update
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-06-11 23:33:34 +02:00
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
2023-05-30 20:40:18 +02:00
|
|
|
{
|
2023-06-11 23:33:34 +02:00
|
|
|
if (other.gameObject.CompareTag("Player"))
|
2023-05-30 20:40:18 +02:00
|
|
|
{
|
2023-06-11 23:33:34 +02:00
|
|
|
SceneManager.LoadScene(SceneName);
|
2023-05-30 20:40:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|