补充事件参数 + 完善 UI 设计

- 事件节点在 EventNodeComponent.cs 的 StartEvent/EndEvent 会携带 runId/nodeId/nodeType/sequenceIndex
- 商店节点在 ShopNodeComponent.cs 也会带同一套字段
- 战斗节点通过 CombatNodeComponent.cs 把上下文传进 CombatScheduler,再由 CombatRunningPhaseState.cs 发 NodeEnterEventArgs、由   CombatSchedulerFlowCoordinator.cs 发 NodeCompleteEventArgs
- NodeCompleteEventArgs.cs 现在新增了 SequenceIndex
- 各种 UI 的覆盖问题
This commit is contained in:
SepComet
2026-03-08 11:51:00 +08:00
parent 5c6f9bf3a4
commit 47ed27bebb
16 changed files with 277 additions and 52 deletions
@@ -4,6 +4,7 @@ using GeometryTD.CustomEvent;
using GeometryTD.DataTable;
using GeometryTD.Definition;
using GeometryTD.Entity;
using GeometryTD.Procedure;
using GeometryTD.UI;
using UnityEngine;
using UnityGameFramework.Runtime;
@@ -67,7 +68,11 @@ namespace GeometryTD.CustomComponent
public bool Start(
DRLevel level,
IReadOnlyList<DRLevelPhase> phases,
IReadOnlyDictionary<int, IReadOnlyList<DRLevelSpawnEntry>> spawnEntriesByPhaseId)
IReadOnlyDictionary<int, IReadOnlyList<DRLevelSpawnEntry>> spawnEntriesByPhaseId,
string runId = null,
int nodeId = 0,
RunNodeType nodeType = RunNodeType.None,
int sequenceIndex = -1)
{
if (!_initialized || _context.Entity == null)
{
@@ -89,6 +94,10 @@ namespace GeometryTD.CustomComponent
_context.IsFinishAsVictory = true;
_context.CurrentLevel = level;
_context.RunId = runId;
_context.NodeId = nodeId;
_context.NodeType = nodeType;
_context.SequenceIndex = sequenceIndex;
_context.CombatInRunResourceManager.InitializeForCombat(level);
for (int i = 0; i < phases.Count; i++)
{
@@ -2,6 +2,7 @@ using System.Collections.Generic;
using GeometryTD.CustomEvent;
using GeometryTD.DataTable;
using GeometryTD.Definition;
using GeometryTD.Procedure;
using GeometryTD.UI;
using UnityEngine;
using UnityGameFramework.Runtime;
@@ -55,6 +56,10 @@ namespace GeometryTD.CustomComponent
_context.IsFinishAsVictory = true;
_context.IsCompleted = false;
_context.NodeEnterFired = false;
_context.RunId = null;
_context.NodeId = 0;
_context.NodeType = RunNodeType.None;
_context.SequenceIndex = -1;
}
public void CleanupAllCombatEntities()
@@ -196,7 +201,15 @@ namespace GeometryTD.CustomComponent
public void CompleteNormalCombatAndNotify(bool succeeded)
{
CompleteCombat(succeeded);
GameEntry.Event.Fire(this, NodeCompleteEventArgs.Create());
GameEntry.Event.Fire(
this,
NodeCompleteEventArgs.Create(
_context.RunId,
_context.NodeId,
_context.NodeType,
_context.SequenceIndex,
succeeded,
GameEntry.PlayerInventory != null ? GameEntry.PlayerInventory.GetInventorySnapshot() : null));
}
public void CompleteFailureCombatAndNotify()
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using GeometryTD.DataTable;
using GeometryTD.Entity;
using GeometryTD.Procedure;
using GeometryTD.UI;
using UnityGameFramework.Runtime;
@@ -29,5 +30,9 @@ namespace GeometryTD.CustomComponent
public bool IsCompleted { get; set; }
public bool NodeEnterFired { get; set; }
public CombatSettlementContext SettlementContext { get; set; }
public string RunId { get; set; }
public int NodeId { get; set; }
public RunNodeType NodeType { get; set; }
public int SequenceIndex { get; set; }
}
}
@@ -38,7 +38,13 @@ namespace GeometryTD.CustomComponent
if (!Context.NodeEnterFired)
{
Context.NodeEnterFired = true;
GameEntry.Event.Fire(Flow, NodeEnterEventArgs.Create());
GameEntry.Event.Fire(
Flow,
NodeEnterEventArgs.Create(
Context.RunId,
Context.NodeId,
Context.NodeType,
Context.SequenceIndex));
}
Log.Info(