CombatNodeComponent 战斗节点功能补全
- 失败逻辑补全:添加基地血量,当血量归0时强制结束关卡 - `CombatInfoForm` 刷新逻辑补全:通过订阅 `CombatCoinChanged/Process/BaseHpChangedEventArgs` 来更新 UI,同时可以避免一点小变动刷新整个 UI - `CombatSelectForm` 逻辑优化:订阅 `CombatCoinChanged` 来实时更新当前 Coin 是否满足操作条件
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace GeometryTD.CustomEvent
|
||||
{
|
||||
public class CombatBaseHpChangedEventArgs : GameEventArgs
|
||||
{
|
||||
public static int EventId => typeof(CombatBaseHpChangedEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public int CurrentBaseHp { get; private set; }
|
||||
|
||||
|
||||
public CombatBaseHpChangedEventArgs()
|
||||
{
|
||||
CurrentBaseHp = 100;
|
||||
}
|
||||
|
||||
public static CombatBaseHpChangedEventArgs Create(int currentBaseHp)
|
||||
{
|
||||
var args = ReferencePool.Acquire<CombatBaseHpChangedEventArgs>();
|
||||
args.CurrentBaseHp = currentBaseHp;
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
CurrentBaseHp = 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6bad381b11f48fc96b6f421d1c038b8
|
||||
timeCreated: 1772423097
|
||||
@@ -0,0 +1,33 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace GeometryTD.CustomEvent
|
||||
{
|
||||
public class CombatCoinChangedEventArgs : GameEventArgs
|
||||
{
|
||||
public static int EventId => typeof(CombatCoinChangedEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public int CurrentCoin { get; private set; }
|
||||
|
||||
|
||||
public CombatCoinChangedEventArgs()
|
||||
{
|
||||
CurrentCoin = 0;
|
||||
}
|
||||
|
||||
public static CombatCoinChangedEventArgs Create(int currentCoin)
|
||||
{
|
||||
var args = ReferencePool.Acquire<CombatCoinChangedEventArgs>();
|
||||
args.CurrentCoin = currentCoin;
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
CurrentCoin = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b2164bc737d4523936e658ee5054c24
|
||||
timeCreated: 1772423027
|
||||
@@ -0,0 +1,37 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace GeometryTD.CustomEvent
|
||||
{
|
||||
public class CombatProcessEventArgs : GameEventArgs
|
||||
{
|
||||
public static int EventId => typeof(CombatProcessEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public int CurrentPhase { get; private set; }
|
||||
|
||||
public int TotalPhase { get; private set; }
|
||||
|
||||
public CombatProcessEventArgs()
|
||||
{
|
||||
CurrentPhase = 0;
|
||||
TotalPhase = 0;
|
||||
}
|
||||
|
||||
public static CombatProcessEventArgs Create(int currentPhase, int totalPhase)
|
||||
{
|
||||
var args = ReferencePool.Acquire<CombatProcessEventArgs>();
|
||||
args.CurrentPhase = currentPhase;
|
||||
args.TotalPhase = totalPhase;
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
CurrentPhase = 0;
|
||||
TotalPhase = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 237e1ef1e2614b2ab89d4d57bdd5174c
|
||||
timeCreated: 1772422933
|
||||
Reference in New Issue
Block a user