Files
SimUL/Assets/Scripts/Managers/DontDestroy.cs
T
Vladimir Koshevarov 39ce016c1e refactor
2023-03-15 18:05:32 +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);
}
}