InventoryGenerationComponent + TagRegistryComponent 收口
This commit is contained in:
@@ -196,45 +196,6 @@ namespace GeometryTD.Procedure
|
||||
|
||||
_loadedFlag[ne.DataTableAssetName] = true;
|
||||
Log.Info("Load data table '{0}' OK.", ne.DataTableAssetName);
|
||||
|
||||
if (ne.DataTableAssetName == AssetUtility.GetDataTableAsset("TagConfig", false))
|
||||
{
|
||||
ReloadTagRegistriesFromLoadedTables();
|
||||
}
|
||||
|
||||
if (ne.DataTableAssetName == AssetUtility.GetDataTableAsset("Tag", false))
|
||||
{
|
||||
ReloadTagRegistriesFromLoadedTables();
|
||||
}
|
||||
|
||||
if (ne.DataTableAssetName == AssetUtility.GetDataTableAsset("RarityTagBudget", false))
|
||||
{
|
||||
var tagBudgetTable = GameEntry.DataTable.GetDataTable<DRRarityTagBudget>();
|
||||
if (tagBudgetTable != null)
|
||||
{
|
||||
RarityTagBudgetRuleRegistry.LoadFromRows(tagBudgetTable.GetAllDataRows());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ReloadTagRegistriesFromLoadedTables()
|
||||
{
|
||||
DRTagConfig[] tagConfigRows = null;
|
||||
var tagConfigTable = GameEntry.DataTable.GetDataTable<DRTagConfig>();
|
||||
if (tagConfigTable != null)
|
||||
{
|
||||
tagConfigRows = tagConfigTable.GetAllDataRows();
|
||||
}
|
||||
|
||||
DRTag[] tagRows = null;
|
||||
var tagTable = GameEntry.DataTable.GetDataTable<DRTag>();
|
||||
if (tagTable != null)
|
||||
{
|
||||
tagRows = tagTable.GetAllDataRows();
|
||||
TagGenerationRuleRegistry.LoadFromRows(tagRows);
|
||||
}
|
||||
|
||||
TagDefinitionRegistry.ReloadFromRows(tagConfigRows, tagRows);
|
||||
}
|
||||
|
||||
private void OnLoadDataTableFailure(object sender, GameEventArgs e)
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace GeometryTD.Procedure
|
||||
GameEntry.Event.Subscribe(NodeEnterEventArgs.EventId, OnNodeEnter);
|
||||
GameEntry.Event.Subscribe(NodeMapNodeEnterRequestedEventArgs.EventId, OnNodeMapNodeEnterRequested);
|
||||
|
||||
GameEntry.TagRegistry.OnInit();
|
||||
GameEntry.EventNode.OnInit();
|
||||
GameEntry.CombatNode.OnInit(LevelThemeType.Plain);
|
||||
GameEntry.ShopNode.OnInit();
|
||||
|
||||
Reference in New Issue
Block a user