/// <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); }
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); }