Files
5.24BuYu/Assets/Framework/Base/Singleton.cs
T
2025-12-11 16:40:24 +08:00

18 lines
334 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Singleton<T> where T:new()
{
private static T _instance;
public static T Instance
{
get
{
if (_instance == null)
_instance = new T();
return _instance;
}
}
}