Esempio n. 1
0
        /// <summary>
        /// 选择性隐藏父级
        /// </summary>
        /// <param name="panel"></param>
        /// <param name="bridge"></param>
        protected void TryChangeParentState(IUIPanel panel, BridgeInfo bridge)
        {
            if (bridge.showModel.baseShow == BaseShow.Hide)
            {
                var parent = panel.Parent;

                if (parent != null)
                {
                    var parentDic = GetParentDic(parent.Root);
                    panel.SetParent(parent.Root, parentDic, transRefDic);
                    HidePanelInteral(panel, parent);
                }
            }

            if (bridge.showModel.baseShow == BaseShow.Destroy)
            {
                var parent = panel.Parent;
                if (parent != null && parent.ChildPanels.Count > 0)
                {
                    var parentDic = GetParentDic(parent.Root);
                    panel.SetParent(parent.Root, parentDic, transRefDic);
                    parent.ChildPanels.Remove(panel);

                    if (hidedPanelStack.ContainsKey(parent))
                    {
                        if (!hidedPanelStack.ContainsKey(panel))
                        {
                            hidedPanelStack[panel] = new Stack <IUIPanel>();
                        }
                        while (hidedPanelStack[parent].Count > 0)
                        {
                            hidedPanelStack[panel].Push(hidedPanelStack[parent].Pop());
                        }
                    }

                    parent.Close();
                }
            }
        }
 /// <summary>
 /// 隐藏整个面板中其他的ui界面
 /// </summary>
 /// <param name="panel"></param>
 /// <param name="bridge"></param>
 protected void TryHideGroup(IUIPanel panel, BridgeInfo bridge)
 {
     if ((bridge.showModel.single))
     {
         var parent = createdPanels.Find(x => x.Name == bridge.inNode);
         if (parent != null)
         {
             panel.SetParent(Trans);
         }
         foreach (var oldPanel in createdPanels)
         {
             if (oldPanel != panel)
             {
                 HidePanelInteral(panel, oldPanel);
             }
         }
     }
 }