任务一:单例

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BaseManager<T> where T:new()
{
    public static T instane;

    public static T GetInstace()
    {
        if (instane == null)
        {
            instane = new T();
        }
        return instane;
    }

}
public class GameManager:BaseManager<GameManager>
{
  
}

  

posted @ 2020-09-13 23:57  青梨  阅读(197)  评论(0编辑  收藏  举报