Ejemplo n.º 1
0
        /// <summary>
        /// 选择性隐藏父级
        /// </summary>
        /// <param name="panel"></param>
        /// <param name="bridge"></param>
        private void TryChangeParentState(IPanelBase panel, BridgeInfo bridge)
        {
            if (bridge.showModel.baseShow == BaseShow.Hide)
            {
                var parent = panel.Parent;
                if (parent != null)
                {
                    panel.SetParent(parent.Root);
                    HidePanelInteral(panel, parent);
                }
            }

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

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

                    parent.Close();
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 隐藏整个面板中其他的ui界面
 /// </summary>
 /// <param name="panel"></param>
 /// <param name="bridge"></param>
 private void TryHideGroup(IPanelBase 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);
             }
         }
     }
 }