using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SingletonMono<T> : MonoBehaviour where T:MonoBehaviour
{
#region 单例
private static T instance;
public static T Instance
{
get
{
if (instance == null)
{
GameObject obj = new GameObject(typeof(T).Name);
DontDestroyOnLoad(obj);