【unity】简单的泛型单例类

以下是一个简单的泛型单例类,可以让所有继承它的类都成为单例:

using UnityEngine;

public abstract class Singleton<T> where T : Singleton<T>
{
   
    
    
    private static T _instance

猜你喜欢

转载自blog.csdn.net/qq_36303853/article/details/130622810