示例#1
0
        public void OpenUIForms(params string[] uiFormNames)
        {
            for (int i = 0; i < uiFormNames.Length; i++)
            {
                string uiFormName = uiFormNames[i];

                if (m_DicOpenUIForms.ContainsKey(uiFormName))
                {
                    continue;
                }

                UIConfigData uiInfo = uIConfig.GetDataByKey(uiFormName);
                if (uiInfo == null)
                {
                    Debug.LogWarning(GetType() + "/OpenUIForms()/ui is null! uiFormName:" + uiFormName);
                    return;
                }

                if (m_DicAllUIForms.ContainsKey(uiFormName))
                {
                    openUIForm(uiFormName);
                }
                else
                {
                    m_DicAllUIForms.Add(uiFormName, null);
                    loadUIForm(uiInfo, uiFormName);
                }
            }
        }
示例#2
0
文件: UIManager.cs 项目: zqbb/MxDebug
        public void OpenUIForms(params string[] uiFormNames)
        {
            for (int i = 0; i < uiFormNames.Length; i++)
            {
                string uiFormName = uiFormNames[i];

                if (dicOpenUIForms.ContainsKey(uiFormName))
                {
                    continue;
                }

                UIConfigData uiInfo = uIConfig.GetDataByKey(uiFormName);
                if (uiInfo == null)
                {
                    Debug.LogWarning(GetType() + "/OpenUIForms()/ Open ui error! ui is null! uiFormName:" + uiFormName);
                    return;
                }

                if (dicAllUIForms.ContainsKey(uiFormName))
                {
                    ChangeUIFormState(uiFormName, UIFormState.Open);
                    if (dicAllUIForms[uiFormName] != null)
                    {
                        dicAllUIForms[uiFormName].gameObject.SetActive(true);
                    }
                    if (dicAllUIForms[uiFormName] != null)
                    {
                        dicOpenUIForms.Add(uiFormName, dicAllUIForms[uiFormName]);
                    }
                }
                else
                {
                    dicAllUIForms.Add(uiFormName, null);
                    ChangeUIFormState(uiFormName, UIFormState.Loading);
                    LoadUIForm(uiInfo, uiFormName);
                }
            }
        }