public static BubblePool <T> GetInstance(int total) { if (instance == null) { instance = new BubblePool <T>(total); } return(instance); }
public void Init(MagicWallManager manager) { if (!hasInit) { hasInit = true; _manager = manager; _clearBubbleAgentPool = BubblePool <ClearBubbleAgent> .GetInstance(_manager.managerConfig.BackgroundClearBubblePoolSize); _dimBubbleAgentPool = BubblePool <DimBubbleAgent> .GetInstance(_manager.managerConfig.BackgroundDimBubblePoolSize); // 初始化对象池 PrepareData(); _doBeforeRun = false; _bubbleAgents = new List <BubbleAgent>(); } }