Files
SimUL/Assets/Scripts/DontDestroy.cs
T
2023-03-08 13:40:01 +02:00

19 lines
333 B
C#

using UnityEngine;
public class DontDestroy : MonoBehaviour
{
public static DontDestroy Instance { get; private set; }
private void Awake()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(gameObject);
}
else
Destroy(gameObject);
}
}