﻿using UnityEngine;

public class SingletonBase<T> : MonoBehaviour
{
    protected static SingletonBase<T> instance;

    protected virtual void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this);
        }

        instance = this;
        DontDestroyOnLoad(this);
    }
}
