迁移数据表到 Luban,移除 JsonNet、EnumUtility

This commit is contained in:
2026-09-13 14:08:14 +08:00
parent 4003b3aaba
commit de53890de6
607 changed files with 18515 additions and 3257 deletions
@@ -1,6 +1,4 @@
using GameFramework.DataTable;
using GameFramework.UI;
using SepCore.DataTable;
using SepCore.Definition;
using SepCore.CustomUtility;
using UnityGameFramework.Runtime;
@@ -16,14 +14,8 @@ namespace SepCore.UI
public static bool HasUIForm(this UIComponent uiComponent, int uiFormId, string uiGroupName = null)
{
IDataTable<DRUIForm> dtUIForm = GameEntry.DataTable.GetDataTable<DRUIForm>();
DRUIForm drUIForm = dtUIForm.GetDataRow(uiFormId);
if (drUIForm == null)
{
return false;
}
string assetName = AssetUtility.GetUIFormAsset(drUIForm.AssetName);
UIFormConfig formConfig = GameEntry.Luban.Get<UIFormConfig>(uiFormId);
string assetName = AssetUtility.GetUIFormAsset(formConfig.AssetName);
if (string.IsNullOrEmpty(uiGroupName))
{
return uiComponent.HasUIForm(assetName);
@@ -45,14 +37,8 @@ namespace SepCore.UI
public static UGuiForm GetUIForm(this UIComponent uiComponent, int uiFormId, string uiGroupName = null)
{
IDataTable<DRUIForm> dtUIForm = GameEntry.DataTable.GetDataTable<DRUIForm>();
DRUIForm drUIForm = dtUIForm.GetDataRow(uiFormId);
if (drUIForm == null)
{
return null;
}
string assetName = AssetUtility.GetUIFormAsset(drUIForm.AssetName);
UIFormConfig formConfig = GameEntry.Luban.Get<UIFormConfig>(uiFormId);
string assetName = AssetUtility.GetUIFormAsset(formConfig.AssetName);
UIForm uiForm = null;
if (string.IsNullOrEmpty(uiGroupName))
{
@@ -92,16 +78,9 @@ namespace SepCore.UI
public static int? OpenUIForm(this UIComponent uiComponent, int uiFormId, object userData = null)
{
IDataTable<DRUIForm> dtUIForm = GameEntry.DataTable.GetDataTable<DRUIForm>();
DRUIForm drUIForm = dtUIForm.GetDataRow(uiFormId);
if (drUIForm == null)
{
Log.Warning("Can not load UI form '{0}' from data table.", uiFormId.ToString());
return null;
}
string assetName = AssetUtility.GetUIFormAsset(drUIForm.AssetName);
if (!drUIForm.AllowMultiInstance)
UIFormConfig formConfig = GameEntry.Luban.Get<UIFormConfig>(uiFormId);
string assetName = AssetUtility.GetUIFormAsset(formConfig.AssetName);
if (!formConfig.AllowMultiInstance)
{
if (uiComponent.IsLoadingUIForm(assetName))
{
@@ -114,8 +93,8 @@ namespace SepCore.UI
}
}
return uiComponent.OpenUIForm(assetName, drUIForm.UIGroupName, Constant.AssetPriority.UIFormAsset,
drUIForm.PauseCoveredUIForm, userData);
return uiComponent.OpenUIForm(assetName, formConfig.UIGroupName, Constant.AssetPriority.UIFormAsset,
formConfig.PauseCoveredUIForm, userData);
}
}
}