summaryrefslogtreecommitdiff
path: root/WorldlineKeepers/Assets/Scripts/Common/Singleton.cs
blob: bb382e2a6d466362183a22b686d60f370317655e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System;

public class Singleton<T> where T : class, new()
{
    private static T _instance;

    public static T Instance
    {
        get
        {
            if (_instance == null)
                _instance = Activator.CreateInstance<T>();
            return _instance;
        }
    }
}