Пример #1
0
 public void HideOpenUIForms()
 {
     foreach (string uiFormName in m_DicOpenUIForms.Keys)
     {
         UIFormItem uiFormItem = m_DicOpenUIForms[uiFormName];
         if (uiFormItem != null)
         {
             uiFormItem.gameObject.SetActive(false);
         }
     }
 }
Пример #2
0
 public void DisplayOpenUIForms()
 {
     foreach (string uiFormName in dicOpenUIForms.Keys)
     {
         UIFormItem uiFormItem = dicOpenUIForms[uiFormName];
         if (uiFormItem != null)
         {
             uiFormItem.gameObject.SetActive(true);
         }
     }
 }
Пример #3
0
 private void DisplayOpenUIForms()
 {
     foreach (string uiFormName in dicOpenUIForms.Keys)
     {
         UIFormItem uiFormItem = dicOpenUIForms[uiFormName];
         if (uiFormItem != null && dicUIFormState[uiFormName] == UIFormState.Open)
         {
             uiFormItem.gameObject.SetActive(true);
         }
         ChangeUIFormState(uiFormName, UIFormState.Hiding);
     }
 }
Пример #4
0
 private void HideOpenUIForms()
 {
     foreach (string uiFormName in dicOpenUIForms.Keys)
     {
         UIFormItem uiFormItem = dicOpenUIForms[uiFormName];
         if (uiFormItem != null)
         {
             uiFormItem.gameObject.SetActive(false);
         }
         ChangeUIFormState(uiFormName, UIFormState.Open);
     }
 }
Пример #5
0
        public void DisplayOpenUIForms()
        {
            foreach (string uiFormName in m_DicOpenUIForms.Keys)
            {
                UIFormItem uiFormItem = m_DicOpenUIForms[uiFormName];
                if (uiFormItem != null)
                {
                    uiFormItem.gameObject.SetActive(true);
                }
            }

            refreshReverseChangeUIForms();
        }
Пример #6
0
 public void HideOther(string excludeUIFormName)
 {
     foreach (string uiFormName in m_DicOpenUIForms.Keys)
     {
         if (uiFormName.Equals(excludeUIFormName))
         {
             continue;
         }
         UIFormItem uiFormItem = m_DicOpenUIForms[uiFormName];
         if (uiFormItem != null)
         {
             uiFormItem.gameObject.SetActive(false);
         }
     }
 }
Пример #7
0
        private void LoadUIFormFinish(string uiFormName, GameObject prefab, Transform parent, UIParam uiParam)
        {
            if (prefab == null)
            {
                ChangeUIFormState(uiFormName, UIFormState.Error);
                if (dicAllUIForms.ContainsKey(uiFormName))
                {
                    dicAllUIForms.Remove(uiFormName);
                }
                Debug.LogWarning(GetType() + "/LoadUIForm()/ load ui error! uiFormName:" + uiFormName);
                return;
            }

            if (dicUIFormState[uiFormName] == UIFormState.Loading)
            {
                ChangeUIFormState(uiFormName, UIFormState.Open);
            }

            GameObject item = Instantiate(prefab, parent);

            item.name = uiFormName;

            UIFormItem uIFormItem = item.GetComponent <UIFormItem>();

            if (uIFormItem == null)
            {
                uIFormItem = item.AddComponent <UIFormItem>();
            }
            uIFormItem.CurrentUIParam = uiParam;
            dicAllUIForms[uiFormName] = uIFormItem;

            Type       type       = Type.GetType(uiFormName);
            BaseUIForm baseUIForm = item.GetComponent <BaseUIForm>();

            if (type != null && baseUIForm == null)
            {
                item.AddComponent(type);
            }

            item.SetActive(dicUIFormState[uiFormName] == UIFormState.Open);

            if (!dicOpenUIForms.ContainsKey(uiFormName) && (dicUIFormState[uiFormName] == UIFormState.Open ||
                                                            dicUIFormState[uiFormName] == UIFormState.Disable))
            {
                dicOpenUIForms.Add(uiFormName, uIFormItem);
            }
        }
Пример #8
0
        private void loadUIFormFinish(string uiFormName, GameObject prefab, Transform parent, UIParam uiParam)
        {
            if (prefab == null)
            {
                if (m_DicAllUIForms.ContainsKey(uiFormName))
                {
                    m_DicAllUIForms.Remove(uiFormName);
                }
                Debug.LogWarning(GetType() + "/loadUIForm()/ load ui error! uiFormName:" + uiFormName);
                return;
            }

            GameObject item = Instantiate(prefab, parent);

            item.name = uiFormName;

            UIFormItem uIFormItem = item.GetComponent <UIFormItem>();

            if (uIFormItem == null)
            {
                uIFormItem = item.AddComponent <UIFormItem>();
            }
            uIFormItem.CurrentUIParam   = uiParam;
            m_DicAllUIForms[uiFormName] = uIFormItem;

            Type type = Type.GetType(uiFormName);

            if (type != null && item.GetComponent <BaseUIForm>() == null)
            {
                item.AddComponent(type);
            }

            BaseUIForm baseUIForm = item.GetComponent <BaseUIForm>();

            if (baseUIForm != null)
            {
                baseUIForm.uIFormsDepth   = uIFormItem.CurrentUIParam.uIFormDepth;
                baseUIForm.uIFormShowMode = uIFormItem.CurrentUIParam.uIFormShowMode;
            }

            if (!m_DicOpenUIForms.ContainsKey(uiFormName))
            {
                openUIForm(uiFormName);
            }
        }