예제 #1
0
 /// <summary>
 /// 创建指定名称的分组
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public PoolCategory CreateCategory(string name)
 {
     if (!categoryDic.TryGetValue(name, out PoolCategory category))
     {
         category = new PoolCategory(name, containerTransform);
         categoryDic.Add(name, category);
     }
     return(category);
 }
예제 #2
0
        private void DoInitialize()
        {
            containerTransform = PersistentUObjectHelper.CreateTransform(POOL_ROOT_NAME);
            UpdateManager.GetInstance().AddUpdater(this);

            PoolCategory globalCategory = CreateCategory(GLOBAL_CATEGORY_NAME);
            GameObject   rootGObject    = new GameObject("Root GObject");
            PoolGroup    rootGObjGroup  = globalCategory.CreateGroup(GLOBAL_GOBJ_ROOT_GROUP_NAME, TemplateType.RuntimeInstance, rootGObject);

            rootGObjGroup.SetPreload(10, 1, null);
        }