示例#1
0
 public static BubblePool <T> GetInstance(int total)
 {
     if (instance == null)
     {
         instance = new BubblePool <T>(total);
     }
     return(instance);
 }
示例#2
0
        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>();
            }
        }