Пример #1
0
    public void HideAllExcept(params string[] exceptPrefabNames)
    {
        List <string> list;

        if (exceptPrefabNames != null && exceptPrefabNames.Length > 0)
        {
            list = new List <string>(exceptPrefabNames);
        }
        else
        {
            list = new List <string>();
        }
        for (int i = this.listBaseUI.get_Count() - 1; i >= 0; i--)
        {
            UIBase uIBase = this.listBaseUI.get_Item(i);
            if (uIBase != null && uIBase.isVisible && !list.Contains(uIBase.prefabName))
            {
                if (uIBase.get_transform() == null)
                {
                    uIBase.Show(false);
                }
                else if (UINodesManager.CheckParentIsCanvas(uIBase.get_transform().get_parent()))
                {
                    uIBase.Show(false);
                }
                else if (uIBase.prefabName == "LoadingUI" || uIBase.prefabName == "BattleLoading")
                {
                    uIBase.Show(false);
                }
            }
        }
    }
Пример #2
0
 public void HideAll()
 {
     for (int i = this.listBaseUI.get_Count() - 1; i >= 0; i--)
     {
         UIBase uIBase = this.listBaseUI.get_Item(i);
         if (uIBase != null && uIBase.isVisible)
         {
             if (uIBase.get_transform() == null)
             {
                 uIBase.Show(false);
             }
             else if (UINodesManager.CheckParentIsCanvas(uIBase.get_transform().get_parent()))
             {
                 uIBase.Show(false);
             }
             else if (uIBase.prefabName == "LoadingUI" || uIBase.prefabName == "BattleLoading")
             {
                 uIBase.Show(false);
             }
         }
     }
 }