示例#1
0
        public void CloseForm(Form form)
        {
            form.OnClosed();
            UIFormData data  = form.formData;
            UIGroup    group = GetGroup(data.groupName);

            group.RemoveForm(form);
            group.Refresh();
            GameObject.Destroy(form.gameObject);
        }
示例#2
0
        public void Open(int formID, object formArg = null)
        {
            UIFormData data = null;

            data = m_UIDatatable.GetData(formID);
            if (data != null)
            {
                InternalOpenUI(data, formArg);
            }
        }
示例#3
0
        public void Open(string formName, object formArg = null)
        {
            UIFormData data = null;

            m_FormDataDict.TryGetValue(formName, out data);
            if (data != null)
            {
                InternalOpenUI(data, formArg);
            }
        }
示例#4
0
        void InternalOpenUI(UIFormData formData, object formArg = null)
        {
            UIGroup group = GetGroup(formData.groupName);
            Form    form  = group.GetForm(formData.uiName);

            if (form == null)
            {
                form = LoadForm(formData.uiName);
                group.AddForm(form);
            }

            if (form == null)
            {
                return;
            }
            form.Init(formData, formArg);
            group.Refresh();
            form.Open();
        }