CypernBuilding/Assets/Standard Assets/2D/Scripts/Restarter.cs

18 lines
378 B
C#
Raw Normal View History

2023-10-26 10:33:05 +02:00
using System;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace UnityStandardAssets._2D
{
public class Restarter : MonoBehaviour
{
private void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player")
{
SceneManager.LoadScene(SceneManager.GetSceneAt(0).name);
}
}
}
}