Unity泛型单例模式
这是单例模式代码:
这个不用挂在场景里 其实也挂不进去
using UnityEngine;
using System.Collections;
public class Singleton<T> : MonoBehaviour where T : Component{
private static readonly object syslock=new object(); //我叫他线程锁
private static T _instance;
public static T Instance
{