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); }
public void Open(int formID, object formArg = null) { UIFormData data = null; data = m_UIDatatable.GetData(formID); if (data != null) { InternalOpenUI(data, formArg); } }
public void Open(string formName, object formArg = null) { UIFormData data = null; m_FormDataDict.TryGetValue(formName, out data); if (data != null) { InternalOpenUI(data, formArg); } }
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(); }