gather-and-defend/Assets/Scripts/General/SingletonBehaviour.cs
Felix Boucher 08c9171262 some tidying up
plusieurs scripts ne semblaient pas au bon endroit. Je les ai donc réorganisé un peu.
2023-05-27 20:38:43 -04:00

16 lines
311 B
C#

using UnityEngine;
public class SingletonBehaviour<T> : MonoBehaviour where T : SingletonBehaviour<T>
{
public static T Instance
{
get;
private set;
}
protected virtual void Awake()
{
if (!Instance) Instance = this as T;
else Destroy(gameObject);
}
}