Ejemplo n.º 1
0
 /// <summary>
 /// 销毁UI面板
 /// </summary>
 /// <param name="panel">销毁指定的UI面板</param>
 public void DestoryPanel(BaseUIPanel panel)
 {
     UIPanleList.Remove(panel);
     if (PanelStack.Contains(panel))
     {
         RemovePanel_in_Stack(panel);
     }
     Object.Destroy(panel);
 }
Ejemplo n.º 2
0
    /// <summary>
    /// 显示最顶部的UI面板
    /// </summary>
    public void ShowPanel()
    {
        var UIPanel = PanelStack.Peek();

        if (UIPanel.Panel_Type == PanelType.Subclass)
        {
            if (!PanelStack.Contains(UIPanel))
            {
                PanelStack.Push(UIPanel);
            }
            TakePanelToTop(UIPanel);
        }
    }
Ejemplo n.º 3
0
 /// <summary>
 /// 显示UI面板
 /// </summary>
 /// <param name="UIPanel">指定被显示的UI面板</param>
 public void ShowPanel(BaseUIPanel UIPanel)
 {
     if (!UIPanel)
     {
         Debug.LogError("错误!,缓存中找不到该Panel");
         return;
     }
     //PanelStack.Push(UIPanel);
     if (!PanelStack.Contains(UIPanel))
     {
         PanelStack.Push(UIPanel);
     }
     TakePanelToTop(UIPanel);
     //UIPanel.gameObject.SetActive(true);
 }
Ejemplo n.º 4
0
    /// <summary>
    /// 显示UI面板
    /// </summary>
    /// <param name="PanelName">UI面板的名称</param>
    public void ShowPanel(string PanelName)
    {
        var UIPanel = GetPanel(PanelName);

        if (!UIPanel)
        {
            CreateUIPanel(PanelName, PanelType.Singleton);
            return;
        }

        if (!PanelStack.Contains(UIPanel))
        {
            PanelStack.Push(UIPanel);
        }
        TakePanelToTop(UIPanel);
        //if (UIPanel) UIPanel.gameObject.SetActive(true);
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 显示UI面板
    /// </summary>
    /// <param name="PanelName">UI面板的名称</param>
    /// <param name="type">UI面板的类型</param>
    public void ShowPanel(string PanelName, PanelType type)
    {
        switch (type)
        {
        case PanelType.Subclass:
            CreateUIPanel(PanelName, type);
            break;

        default:
            var UIPanel = GetPanel(PanelName) ?? null;
            if (UIPanel == null)
            {
                CreateUIPanel(UIPanel);
            }
            if (!PanelStack.Contains(UIPanel))
            {
                PanelStack.Push(UIPanel);
            }
            TakePanelToTop(UIPanel);
            //UIPanel.gameObject.SetActive(true);
            break;
        }
    }