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

18 lines
378 B
C#

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);
}
}
}
}