Пример #1
0
        public void CreatePanel(UIInfoBase uiNode, Bridge bridge, IUIPanel parentPanel)
        {
            Transform root = parentPanel == null ? Trans : parentPanel.Content;

            var createUIHandle = new UICreateHandle();

            createUIHandle.parentPanel = parentPanel;
            createUIHandle.uiNode      = uiNode;
            createUIHandle.bridge      = bridge;
            createUIHandle.parent      = root;
            createUIHandle.onCreate    = CreateUI_Internal;
            createRule.CreatePanel(uiNode, createUIHandle.OnCreate);
        }
        protected void Update()
        {
            if (waitCreateQueue.Count > 0)
            {
                var first = waitCreateQueue[0];
                waitCreateQueue.RemoveAt(0);

                UICreateInfo createInfo;
                if (waitCreateDic.TryGetValue(first, out createInfo))
                {
                    createRule.CreatePanel(createInfo.uiInfo, (x) =>
                    {
                        if (createInfo.onCreate != null)
                        {
                            createInfo.onCreate.Invoke(x);
                        }

                        waitCreateDic.Remove(first);
                        uiCreateInfoPool.Release(createInfo);
                    });
                }
            }
        }