You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
381 B
C#
18 lines
381 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.GetActiveScene().name);
|
|
}
|
|
}
|
|
}
|
|
}
|