19 lines
363 B
C#
Raw Normal View History

2025-05-26 22:02:52 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//1.C#中 泛型的知识
//2.设计模式中 单例模式的知识
public class BaseManager<T> where T:new()
{
private static T instance;
public static T GetInstance()
{
if (instance == null)
instance = new T();
return instance;
}
}