主题
TriggerEncapsulation
AssemblySetup 双端
命名空间 TriggerEncapsulation
csharp
public static class AssemblySetup属性
Loaded 双端
csharp
public static bool Loaded { get; }Loading 双端
csharp
public static bool Loading { get; }方法
Setup 双端
csharp
public static void Setup()BuffManagerExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class BuffManagerExtensionsBuffManager扩展方法,提供便利的Buff添加功能
方法
AddBuff 仅服务端
csharp
public static Buff? AddBuff(this BuffManager buffManager, IGameLink<GameDataBuff> buffLink, Unit? caster = null, uint? stack = null, TimeSpan? duration = null)在BuffManager管理的单位上添加Buff。
buffManager— 目标单位的BuffManagerbuffLink— 要添加的Buff数编Linkcaster— 施法者,可选。如果为null,则使用目标单位自身作为施法者stack— 堆叠数量,可选duration— 持续时间,可选
返回: 创建的Buff实例,如果创建失败则返回null
备注
推荐使用 TimeSpan}) 或扩展方法 unit.AddBuff(),它们语义更直观。 ⚠️ 在技能或效果树中请勿使用此方法,应使用 GameDataEffectBuffAdd 来添加Buff,否则Buff会丢失完整的效果树信息。
AddBuffs 仅服务端
csharp
public static List<Buff> AddBuffs(this BuffManager buffManager, IEnumerable<IGameLink<GameDataBuff>> buffLinks, Unit? caster = null)批量添加多个Buff到BuffManager管理的单位上
buffManager— 目标单位的BuffManagerbuffLinks— 要添加的Buff数编Link数组caster— 施法者,可选。如果为null,则使用目标单位自身作为施法者
返回: 成功添加的Buff列表
AddOrRefreshBuff 仅服务端
csharp
public static Buff? AddOrRefreshBuff(this BuffManager buffManager, IGameLink<GameDataBuff> buffLink, Unit? caster = null, uint? stack = null, TimeSpan? duration = null)尝试添加Buff,如果目标单位已经有相同的Buff则刷新持续时间
buffManager— 目标单位的BuffManagerbuffLink— 要添加的Buff数编Linkcaster— 施法者,可选stack— 堆叠数量,可选duration— 持续时间,可选
返回: 添加或刷新的Buff实例
BuffUtility 双端
命名空间 TriggerEncapsulation
csharp
public static class BuffUtilityBuff 相关的便利功能
方法
AddBuff 仅服务端
csharp
public static Buff? AddBuff(Unit target, IGameLink<GameDataBuff> buffLink, Unit? caster = null, uint? stack = null, TimeSpan? duration = null)在指定单位上添加Buff(推荐方式)。 此方法会自动创建一个虚拟的EffectBuffAdd效果以记录施法者。
target— 目标单位buffLink— 要添加的Buff数编Linkcaster— 施法者,可选。如果为null,则使用目标单位自身作为施法者stack— 堆叠数量,可选duration— 持续时间,可选
返回: 创建的Buff实例,如果创建失败则返回null
备注
这是在没有效果树环境下给单位添加Buff的推荐方式,等价于 target.AddBuff(buffLink, caster, stack, duration)。 ⚠️ 在技能或效果树中请勿使用此方法,应使用 GameDataEffectBuffAdd 来添加Buff,否则Buff会丢失完整的效果树信息。
AddBuff 仅服务端
csharp
public static Buff? AddBuff(IExecutionContext context, IGameLink<GameDataBuff> buffLink, Unit? target = null, uint? stack = null, TimeSpan? duration = null)在执行树上下文中添加Buff,效果将作为当前执行上下文的子节点,保持完整的效果树信息。
context— 执行上下文,效果将作为此上下文的子节点buffLink— 要添加的Buff数编Linktarget— 目标单位,可选。如果为null,则使用上下文的Targetstack— 堆叠数量,可选duration— 持续时间,可选
返回: 创建的Buff实例,如果创建失败则返回null
备注
此重载适用于在效果树中动态添加Buff的场景,会保持效果树的父子关系。 如果不需要效果树上下文,请使用 TimeSpan}) 重载。
DamageUtility 双端
命名空间 TriggerEncapsulation
csharp
public static class DamageUtility伤害相关的便利功能
方法
DealDamage 仅服务端
csharp
public static Damage? DealDamage(Unit target, double amount, IGameLink<GameDataDamageType>? damageType = null, Unit? caster = null, DeathType deathType = DeathType.Normal)对指定单位造成伤害,这个方法会自动创建一个虚拟的EffectDamage效果以记录施法者。 但若要在技能或者效果树中造成伤害,请尽可能使用GameDataEffectDamage来造成伤害,否则伤害会丢失完整的效果树信息。 当前方法应当仅用于在没有效果树环境的情况下直接对单位造成伤害。
target— 目标单位amount— 伤害数值damageType— 伤害类型,可选。如果为null,则使用物理伤害caster— 施法者,可选。如果为null,则使用目标单位自身作为施法者deathType— 致死类型,可选。默认为Normal
返回: 创建的Damage实例,如果创建失败则返回null
DealDamage 仅服务端
csharp
public static Damage? DealDamage(IExecutionContext context, double amount, Unit? target = null, IGameLink<GameDataDamageType>? damageType = null, DeathType deathType = DeathType.Normal)在执行树上下文中造成伤害,效果将作为当前执行上下文的子节点,保持完整的效果树信息。
context— 执行上下文,效果将作为此上下文的子节点amount— 伤害数值target— 目标单位,可选。如果为null,则使用上下文的TargetdamageType— 伤害类型,可选。如果为null,则使用物理伤害deathType— 致死类型,可选。默认为Normal
返回: 创建的Damage实例,如果创建失败则返回null
DebugCheatCreateUnitMessage 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatCreateUnitMessage创建单位消息
构造函数
DebugCheatCreateUnitMessage 双端
csharp
public DebugCheatCreateUnitMessage()属性
UnitId 双端
csharp
public string UnitId { get; set; }OwnerId 双端
csharp
public int OwnerId { get; set; }X 双端
csharp
public float X { get; set; }Y 双端
csharp
public float Y { get; set; }DebugCheatCreateUnitMessageJsonContext 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatCreateUnitMessageJsonContext : JsonSerializerContext, IJsonTypeInfoResolver构造函数
DebugCheatCreateUnitMessageJsonContext 双端
csharp
public DebugCheatCreateUnitMessageJsonContext()DebugCheatCreateUnitMessageJsonContext 双端
csharp
public DebugCheatCreateUnitMessageJsonContext(JsonSerializerOptions options)属性
Single 双端
csharp
public JsonTypeInfo<float> Single { get; }Defines the source generated JSON serialization contract metadata for a given type.
DebugCheatCreateUnitMessage 双端
csharp
public JsonTypeInfo<DebugCheatCreateUnitMessage> DebugCheatCreateUnitMessage { get; }Defines the source generated JSON serialization contract metadata for a given type.
Int32 双端
csharp
public JsonTypeInfo<int> Int32 { get; }Defines the source generated JSON serialization contract metadata for a given type.
String 双端
csharp
public JsonTypeInfo<string> String { get; }Defines the source generated JSON serialization contract metadata for a given type.
Default 双端
csharp
public static DebugCheatCreateUnitMessageJsonContext Default { get; }The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
GeneratedSerializerOptions 双端
csharp
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }The source-generated options associated with this context.
方法
GetTypeInfo 双端
csharp
public override JsonTypeInfo? GetTypeInfo(Type type)DebugCheatGetOrderQueueInfoMessage 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatGetOrderQueueInfoMessage请求单位指令队列信息消息
构造函数
DebugCheatGetOrderQueueInfoMessage 双端
csharp
public DebugCheatGetOrderQueueInfoMessage()属性
UnitEntityId 双端
csharp
public string UnitEntityId { get; set; }单位的EntityId(十六进制字符串)
DebugCheatGetOrderQueueInfoMessageJsonContext 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatGetOrderQueueInfoMessageJsonContext : JsonSerializerContext, IJsonTypeInfoResolver构造函数
DebugCheatGetOrderQueueInfoMessageJsonContext 双端
csharp
public DebugCheatGetOrderQueueInfoMessageJsonContext()DebugCheatGetOrderQueueInfoMessageJsonContext 双端
csharp
public DebugCheatGetOrderQueueInfoMessageJsonContext(JsonSerializerOptions options)属性
DebugCheatGetOrderQueueInfoMessage 双端
csharp
public JsonTypeInfo<DebugCheatGetOrderQueueInfoMessage> DebugCheatGetOrderQueueInfoMessage { get; }Defines the source generated JSON serialization contract metadata for a given type.
String 双端
csharp
public JsonTypeInfo<string> String { get; }Defines the source generated JSON serialization contract metadata for a given type.
Default 双端
csharp
public static DebugCheatGetOrderQueueInfoMessageJsonContext Default { get; }The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
GeneratedSerializerOptions 双端
csharp
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }The source-generated options associated with this context.
方法
GetTypeInfo 双端
csharp
public override JsonTypeInfo? GetTypeInfo(Type type)DebugCheatMessageHandler 双端
命名空间 TriggerEncapsulation
csharp
public static class DebugCheatMessageHandler调试作弊消息处理器
DebugCheatMessageSender 双端
命名空间 TriggerEncapsulation
csharp
public static class DebugCheatMessageSender客户端消息发送器
DebugCheatMessageType 双端
命名空间 TriggerEncapsulation
csharp
public enum DebugCheatMessageType调试作弊系统消息类型
枚举值
ToggleInvincibility = 1— 切换玩家无敌状态请求CreateUnit— 创建单位请求HealAll— 治疗所有单位请求KillAllEnemies— 杀死所有敌人请求TeleportToOrigin— 传送玩家到原点请求GetOrderQueueInfo— 请求单位指令队列信息
DebugCheatOrderQueueInfoResponse 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatOrderQueueInfoResponse指令队列信息响应消息
构造函数
DebugCheatOrderQueueInfoResponse 双端
csharp
public DebugCheatOrderQueueInfoResponse()属性
UnitEntityId 双端
csharp
public string UnitEntityId { get; set; }单位的EntityId
UnitInfo 双端
csharp
public OrderQueueUnitInfo? UnitInfo { get; set; }单位基本信息
Orders 双端
csharp
public List<OrderInfo> Orders { get; set; }指令队列信息
ErrorMessage 双端
csharp
public string? ErrorMessage { get; set; }错误信息(如果查询失败)
DebugCheatOrderQueueInfoResponseJsonContext 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatOrderQueueInfoResponseJsonContext : JsonSerializerContext, IJsonTypeInfoResolver构造函数
DebugCheatOrderQueueInfoResponseJsonContext 双端
csharp
public DebugCheatOrderQueueInfoResponseJsonContext()DebugCheatOrderQueueInfoResponseJsonContext 双端
csharp
public DebugCheatOrderQueueInfoResponseJsonContext(JsonSerializerOptions options)属性
Boolean 双端
csharp
public JsonTypeInfo<bool> Boolean { get; }Defines the source generated JSON serialization contract metadata for a given type.
Single 双端
csharp
public JsonTypeInfo<float> Single { get; }Defines the source generated JSON serialization contract metadata for a given type.
NullableSingle 双端
csharp
public JsonTypeInfo<float?> NullableSingle { get; }Defines the source generated JSON serialization contract metadata for a given type.
ListOrderInfo 双端
csharp
public JsonTypeInfo<List<OrderInfo>> ListOrderInfo { get; }Defines the source generated JSON serialization contract metadata for a given type.
DebugCheatOrderQueueInfoResponse 双端
csharp
public JsonTypeInfo<DebugCheatOrderQueueInfoResponse> DebugCheatOrderQueueInfoResponse { get; }Defines the source generated JSON serialization contract metadata for a given type.
OrderInfo 双端
csharp
public JsonTypeInfo<OrderInfo> OrderInfo { get; }Defines the source generated JSON serialization contract metadata for a given type.
OrderQueueUnitInfo 双端
csharp
public JsonTypeInfo<OrderQueueUnitInfo> OrderQueueUnitInfo { get; }Defines the source generated JSON serialization contract metadata for a given type.
OrderTargetPosition 双端
csharp
public JsonTypeInfo<OrderTargetPosition> OrderTargetPosition { get; }Defines the source generated JSON serialization contract metadata for a given type.
Int32 双端
csharp
public JsonTypeInfo<int> Int32 { get; }Defines the source generated JSON serialization contract metadata for a given type.
String 双端
csharp
public JsonTypeInfo<string> String { get; }Defines the source generated JSON serialization contract metadata for a given type.
Default 双端
csharp
public static DebugCheatOrderQueueInfoResponseJsonContext Default { get; }The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
GeneratedSerializerOptions 双端
csharp
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }The source-generated options associated with this context.
方法
GetTypeInfo 双端
csharp
public override JsonTypeInfo? GetTypeInfo(Type type)DebugCheatPropertyPlayer 双端
命名空间 TriggerEncapsulation
csharp
public readonly struct DebugCheatPropertyPlayer : IGameClass, IExtendedEnum, ISyncIdOwner方法
ToString 双端
csharp
public override string? ToString()operator == 双端
csharp
public static bool operator ==(DebugCheatPropertyPlayer left, DebugCheatPropertyPlayer right)operator != 双端
csharp
public static bool operator !=(DebugCheatPropertyPlayer left, DebugCheatPropertyPlayer right)Equals 双端
csharp
public override bool Equals(object? obj)GetHashCode 双端
csharp
public override int GetHashCode()OnRegisterGameClass 双端
csharp
public static void OnRegisterGameClass()implicit operator 双端
csharp
public static PropertyPlayer implicit operator(DebugCheatPropertyPlayer e)字段
Invincible 双端
csharp
public static readonly DebugCheatPropertyPlayer Invincible玩家无敌状态 (bool) - 当为 true 时,玩家单位不会受到伤害 此属性会在服务器和客户端之间自动同步,并在断线重连后恢复
DebugCheatSimpleMessage 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatSimpleMessage简单作弊请求消息
构造函数
DebugCheatSimpleMessage 双端
csharp
public DebugCheatSimpleMessage()属性
PlayerId 双端
csharp
public int PlayerId { get; set; }MessageType 双端
csharp
public DebugCheatMessageType MessageType { get; set; }DebugCheatSimpleMessageJsonContext 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatSimpleMessageJsonContext : JsonSerializerContext, IJsonTypeInfoResolver构造函数
DebugCheatSimpleMessageJsonContext 双端
csharp
public DebugCheatSimpleMessageJsonContext()DebugCheatSimpleMessageJsonContext 双端
csharp
public DebugCheatSimpleMessageJsonContext(JsonSerializerOptions options)属性
DebugCheatMessageType 双端
csharp
public JsonTypeInfo<DebugCheatMessageType> DebugCheatMessageType { get; }Defines the source generated JSON serialization contract metadata for a given type.
DebugCheatSimpleMessage 双端
csharp
public JsonTypeInfo<DebugCheatSimpleMessage> DebugCheatSimpleMessage { get; }Defines the source generated JSON serialization contract metadata for a given type.
Int32 双端
csharp
public JsonTypeInfo<int> Int32 { get; }Defines the source generated JSON serialization contract metadata for a given type.
Default 双端
csharp
public static DebugCheatSimpleMessageJsonContext Default { get; }The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
GeneratedSerializerOptions 双端
csharp
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }The source-generated options associated with this context.
方法
GetTypeInfo 双端
csharp
public override JsonTypeInfo? GetTypeInfo(Type type)DebugCheatStartOrderQueueTrackingMessage 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatStartOrderQueueTrackingMessage开始跟踪单位指令队列消息
构造函数
DebugCheatStartOrderQueueTrackingMessage 双端
csharp
public DebugCheatStartOrderQueueTrackingMessage()属性
UnitEntityId 双端
csharp
public string UnitEntityId { get; set; }单位的EntityId(十六进制字符串)
DebugCheatStartOrderQueueTrackingMessageJsonContext 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatStartOrderQueueTrackingMessageJsonContext : JsonSerializerContext, IJsonTypeInfoResolver构造函数
DebugCheatStartOrderQueueTrackingMessageJsonContext 双端
csharp
public DebugCheatStartOrderQueueTrackingMessageJsonContext()DebugCheatStartOrderQueueTrackingMessageJsonContext 双端
csharp
public DebugCheatStartOrderQueueTrackingMessageJsonContext(JsonSerializerOptions options)属性
DebugCheatStartOrderQueueTrackingMessage 双端
csharp
public JsonTypeInfo<DebugCheatStartOrderQueueTrackingMessage> DebugCheatStartOrderQueueTrackingMessage { get; }Defines the source generated JSON serialization contract metadata for a given type.
String 双端
csharp
public JsonTypeInfo<string> String { get; }Defines the source generated JSON serialization contract metadata for a given type.
Default 双端
csharp
public static DebugCheatStartOrderQueueTrackingMessageJsonContext Default { get; }The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
GeneratedSerializerOptions 双端
csharp
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }The source-generated options associated with this context.
方法
GetTypeInfo 双端
csharp
public override JsonTypeInfo? GetTypeInfo(Type type)DebugCheatStopOrderQueueTrackingMessage 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatStopOrderQueueTrackingMessage停止跟踪单位指令队列消息
构造函数
DebugCheatStopOrderQueueTrackingMessage 双端
csharp
public DebugCheatStopOrderQueueTrackingMessage()属性
UnitEntityId 双端
csharp
public string UnitEntityId { get; set; }单位的EntityId(十六进制字符串),空字符串表示停止所有跟踪
DebugCheatStopOrderQueueTrackingMessageJsonContext 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatStopOrderQueueTrackingMessageJsonContext : JsonSerializerContext, IJsonTypeInfoResolver构造函数
DebugCheatStopOrderQueueTrackingMessageJsonContext 双端
csharp
public DebugCheatStopOrderQueueTrackingMessageJsonContext()DebugCheatStopOrderQueueTrackingMessageJsonContext 双端
csharp
public DebugCheatStopOrderQueueTrackingMessageJsonContext(JsonSerializerOptions options)属性
DebugCheatStopOrderQueueTrackingMessage 双端
csharp
public JsonTypeInfo<DebugCheatStopOrderQueueTrackingMessage> DebugCheatStopOrderQueueTrackingMessage { get; }Defines the source generated JSON serialization contract metadata for a given type.
String 双端
csharp
public JsonTypeInfo<string> String { get; }Defines the source generated JSON serialization contract metadata for a given type.
Default 双端
csharp
public static DebugCheatStopOrderQueueTrackingMessageJsonContext Default { get; }The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
GeneratedSerializerOptions 双端
csharp
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }The source-generated options associated with this context.
方法
GetTypeInfo 双端
csharp
public override JsonTypeInfo? GetTypeInfo(Type type)DebugCheatSystem 双端
命名空间 TriggerEncapsulation
csharp
public static class DebugCheatSystem调试作弊系统管理器 仅在DEBUG模式和Game.IsDebugTestMode为真时工作
方法
Initialize 双端
csharp
public static void Initialize()初始化作弊系统
SetPlayerInvincible 双端
csharp
public static void SetPlayerInvincible(int playerId, bool invincible)设置玩家无敌状态
IsPlayerInvincible 双端
csharp
public static bool IsPlayerInvincible(int playerId)获取玩家无敌状态
GetUnitInfoAtMousePosition 双端
csharp
public static string GetUnitInfoAtMousePosition()获取鼠标位置下的单位信息(使用Raycast实现)
备注
⚠️ 射线检测模式说明: 使用 RayCastMode.AABB 模式,因为有些游戏中单位没有设置 SimpleBoundingCylinder 数据。 如果单位无法被检测到,请检查其模型是否有有效的包围盒数据。
GetUnitAtMousePosition 双端
csharp
public static Unit? GetUnitAtMousePosition()获取鼠标位置下的单位对象(用于Overlay系统)
GetUnitProperties 双端
csharp
public static string GetUnitProperties(Unit unit)获取单位的详细属性信息
GetAllPlayers 双端
csharp
public static List<Player> GetAllPlayers()获取所有活跃的玩家列表
GetAllUnitsInScene 双端
csharp
public static List<Unit> GetAllUnitsInScene(Scene scene)获取指定场景中的所有单位
DebugCheatSystemInitializer 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatSystemInitializer : IGameClass调试作弊系统初始化器 实现IGameClass接口以在游戏启动时自动初始化作弊系统
构造函数
DebugCheatSystemInitializer 双端
csharp
public DebugCheatSystemInitializer()DebugCheatToggleInvincibilityMessage 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatToggleInvincibilityMessage切换无敌状态消息
构造函数
DebugCheatToggleInvincibilityMessage 双端
csharp
public DebugCheatToggleInvincibilityMessage()属性
PlayerId 双端
csharp
public int PlayerId { get; set; }Invincible 双端
csharp
public bool Invincible { get; set; }DebugCheatToggleInvincibilityMessageJsonContext 双端
命名空间 TriggerEncapsulation
csharp
public class DebugCheatToggleInvincibilityMessageJsonContext : JsonSerializerContext, IJsonTypeInfoResolver构造函数
DebugCheatToggleInvincibilityMessageJsonContext 双端
csharp
public DebugCheatToggleInvincibilityMessageJsonContext()DebugCheatToggleInvincibilityMessageJsonContext 双端
csharp
public DebugCheatToggleInvincibilityMessageJsonContext(JsonSerializerOptions options)属性
Boolean 双端
csharp
public JsonTypeInfo<bool> Boolean { get; }Defines the source generated JSON serialization contract metadata for a given type.
DebugCheatToggleInvincibilityMessage 双端
csharp
public JsonTypeInfo<DebugCheatToggleInvincibilityMessage> DebugCheatToggleInvincibilityMessage { get; }Defines the source generated JSON serialization contract metadata for a given type.
Int32 双端
csharp
public JsonTypeInfo<int> Int32 { get; }Defines the source generated JSON serialization contract metadata for a given type.
Default 双端
csharp
public static DebugCheatToggleInvincibilityMessageJsonContext Default { get; }The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
GeneratedSerializerOptions 双端
csharp
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }The source-generated options associated with this context.
方法
GetTypeInfo 双端
csharp
public override JsonTypeInfo? GetTypeInfo(Type type)EDebugCheatPropertyPlayer 双端
命名空间 TriggerEncapsulation
csharp
public enum EDebugCheatPropertyPlayer扩展 PropertyPlayer 枚举,添加调试作弊相关的玩家属性
枚举值
Invincible— 玩家无敌状态 (bool) - 当为 true 时,玩家单位不会受到伤害 此属性会在服务器和客户端之间自动同步,并在断线重连后恢复
ExecutionContextBuffExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class ExecutionContextBuffExtensionsIExecutionContext扩展方法,提供在执行树中添加Buff的便利功能
方法
AddBuff 仅服务端
csharp
public static Buff? AddBuff(this IExecutionContext context, IGameLink<GameDataBuff> buffLink, Unit? target = null, uint? stack = null, TimeSpan? duration = null)在执行树上下文中添加Buff,效果将作为当前执行上下文的子节点,保持完整的效果树信息。
context— 执行上下文,效果将作为此上下文的子节点buffLink— 要添加的Buff数编Linktarget— 目标单位,可选。如果为null,则使用上下文的Targetstack— 堆叠数量,可选duration— 持续时间,可选
返回: 创建的Buff实例,如果创建失败则返回null
ExecutionContextDamageExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class ExecutionContextDamageExtensionsIExecutionContext扩展方法,提供在执行树中造成伤害的便利功能
方法
DealDamage 仅服务端
csharp
public static Damage? DealDamage(this IExecutionContext context, double amount, Unit? target = null, IGameLink<GameDataDamageType>? damageType = null, DeathType deathType = DeathType.Normal)在执行树上下文中造成伤害,效果将作为当前执行上下文的子节点,保持完整的效果树信息。
context— 执行上下文,效果将作为此上下文的子节点amount— 伤害数值target— 目标单位,可选。如果为null,则使用上下文的TargetdamageType— 伤害类型,可选。如果为null,则使用物理伤害deathType— 致死类型,可选。默认为Normal
返回: 创建的Damage实例,如果创建失败则返回null
ExecutionContextHealingExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class ExecutionContextHealingExtensionsIExecutionContext扩展方法,提供在执行树中进行治疗的便利功能
方法
Heal 仅服务端
csharp
public static Healing? Heal(this IExecutionContext context, double amount, Unit? target = null, PropertyVital? vitalProperty = null)在执行树上下文中进行治疗,效果将作为当前执行上下文的子节点,保持完整的效果树信息。
context— 执行上下文,效果将作为此上下文的子节点amount— 治疗数值target— 目标单位,可选。如果为null,则使用上下文的TargetvitalProperty— 要治疗的活力值类型,可选。如果为null,则治疗生命值
返回: 创建的Healing实例,如果创建失败则返回null
GeneratedMessageHandlers 双端
命名空间 TriggerEncapsulation
csharp
public static class GeneratedMessageHandlers自动生成的消息处理器注册类。 此程序集没有公开的消息处理器方法。
方法
RegisterAll 双端
csharp
public static void RegisterAll()注册所有带有 MessageHandlerAttribute 的消息处理器。
HealingUtility 双端
命名空间 TriggerEncapsulation
csharp
public static class HealingUtility治疗相关的便利功能
方法
Heal 仅服务端
csharp
public static Healing? Heal(Unit target, double amount, PropertyVital? vitalProperty = null, Unit? caster = null)对指定单位进行治疗,这个方法会自动创建一个虚拟的EffectUnitModifyVital效果以记录施法者。 但若要在技能或者效果树中进行治疗,请尽可能使用GameDataEffectUnitModifyVital,否则治疗会丢失完整的效果树信息。 当前方法应当仅用于在没有效果树环境的情况下直接对单位进行治疗。
target— 目标单位amount— 治疗数值vitalProperty— 要治疗的活力值类型,可选。如果为null,则治疗生命值caster— 施法者,可选。如果为null,则使用目标单位自身作为施法者
返回: 创建的Healing实例,如果创建失败则返回null
Heal 仅服务端
csharp
public static Healing? Heal(IExecutionContext context, double amount, Unit? target = null, PropertyVital? vitalProperty = null)在执行树上下文中进行治疗,效果将作为当前执行上下文的子节点,保持完整的效果树信息。
context— 执行上下文,效果将作为此上下文的子节点amount— 治疗数值target— 目标单位,可选。如果为null,则使用上下文的TargetvitalProperty— 要治疗的活力值类型,可选。如果为null,则治疗生命值
返回: 创建的Healing实例,如果创建失败则返回null
ItemModPropertyExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class ItemModPropertyExtensions物品属性遍历扩展方法集合 提供便利的方法来遍历物品上的各种属性加成
方法
EnumerateRegularModifications 双端
csharp
public static IEnumerable<RegularModificationInfo> EnumerateRegularModifications(this Item item, ItemSlotType slotType)遍历物品上指定槽位类型的所有普通属性修改
item— 目标物品slotType— 槽位类型
返回: 指定槽位类型的所有普通属性修改
EnumerateDynamicModifications 双端
csharp
public static IEnumerable<DynamicModificationInfo> EnumerateDynamicModifications(this Item item, ItemSlotType slotType)遍历物品上指定槽位类型的所有动态属性修改
item— 目标物品slotType— 槽位类型
返回: 指定槽位类型的所有动态属性修改
EnumerateAllModifications 双端
csharp
public static IEnumerable<UnifiedModificationInfo> EnumerateAllModifications(this Item item, ItemSlotType slotType)遍历物品上指定槽位类型的所有属性修改(普通+动态)
item— 目标物品slotType— 槽位类型
返回: 指定槽位类型的所有属性修改
EnumerateAllModifications 双端
csharp
public static IEnumerable<UnifiedModificationInfo> EnumerateAllModifications(this Item item)遍历物品上所有槽位类型的所有属性修改(普通+动态)
item— 目标物品
返回: 所有槽位类型的所有属性修改
GetModificationValue 双端
csharp
public static double GetModificationValue(this Item item, ItemSlotType slotType, IGameLink<GameDataUnitProperty> propertyLink, PropertySubType subType)获取物品上指定槽位类型、属性、子类型的属性修改值(普通+动态)
item— 目标物品slotType— 槽位类型propertyLink— 属性链接subType— 属性子类型
返回: 属性修改值,如果不存在则返回0
HasModification 双端
csharp
public static bool HasModification(this Item item, ItemSlotType slotType, IGameLink<GameDataUnitProperty> propertyLink, PropertySubType subType)检查物品上是否存在指定槽位类型、属性、子类型的属性修改
item— 目标物品slotType— 槽位类型propertyLink— 属性链接subType— 属性子类型
返回: 是否存在属性修改
GetModificationCount 双端
csharp
public static int GetModificationCount(this Item item, ItemSlotType slotType)获取物品上指定槽位类型的所有属性修改数量
item— 目标物品slotType— 槽位类型
返回: 属性修改数量
OrderInfo 双端
命名空间 TriggerEncapsulation
csharp
public class OrderInfo指令详细信息
构造函数
OrderInfo 双端
csharp
public OrderInfo()属性
Index 双端
csharp
public int Index { get; set; }指令在队列中的索引
IsCurrent 双端
csharp
public bool IsCurrent { get; set; }是否为当前执行的指令
AbilityName 双端
csharp
public string AbilityName { get; set; }技能/指令类型名称
CommandType 双端
csharp
public string CommandType { get; set; }指令类型和索引
CommandIndex 双端
csharp
public string CommandIndex { get; set; }指令索引
TargetDescription 双端
csharp
public string TargetDescription { get; set; }目标描述
TargetPosition 双端
csharp
public OrderTargetPosition? TargetPosition { get; set; }目标位置(如果有的话)
Stage 双端
csharp
public string Stage { get; set; }指令阶段
State 双端
csharp
public string State { get; set; }指令状态
Flags 双端
csharp
public string Flags { get; set; }指令标志
IsUnInterruptible 双端
csharp
public bool IsUnInterruptible { get; set; }是否不可打断
OrderQueueUnitInfo 双端
命名空间 TriggerEncapsulation
csharp
public class OrderQueueUnitInfo单位基本信息
构造函数
OrderQueueUnitInfo 双端
csharp
public OrderQueueUnitInfo()属性
Name 双端
csharp
public string Name { get; set; }PlayerId 双端
csharp
public int PlayerId { get; set; }X 双端
csharp
public float X { get; set; }Y 双端
csharp
public float Y { get; set; }Z 双端
csharp
public float Z { get; set; }IsAlive 双端
csharp
public bool IsAlive { get; set; }HasOrderQueue 双端
csharp
public bool HasOrderQueue { get; set; }IsQueuePaused 双端
csharp
public bool IsQueuePaused { get; set; }OrderCount 双端
csharp
public int OrderCount { get; set; }OrderTargetPosition 双端
命名空间 TriggerEncapsulation
csharp
public class OrderTargetPosition指令目标位置
构造函数
OrderTargetPosition 双端
csharp
public OrderTargetPosition()属性
X 双端
csharp
public float X { get; set; }Y 双端
csharp
public float Y { get; set; }Z 双端
csharp
public float Z { get; set; }TargetType 双端
csharp
public string TargetType { get; set; }目标类型(Unit, ScenePoint, Angle等)
AngleRadians 双端
csharp
public float? AngleRadians { get; set; }角度目标的角度值(弧度)
SoundUtility 仅客户端
命名空间 TriggerEncapsulation
csharp
public static class SoundUtilityProcedural-style convenience methods for playing sounds and music. Internally manages ActorSound instances so callers don't need to handle object lifecycle.
属性
IsMusicPlaying 仅客户端
csharp
public static bool IsMusicPlaying { get; }Gets whether background music is currently playing.
方法
PlaySound 仅客户端
csharp
public static ActorSound? PlaySound(IGameLink<GameDataActorSound> soundLink)Plays a sound effect. The sound will be automatically cleaned up when it finishes.
soundLink— The sound actor data link from the data editor.
返回: The created ActorSound, or null if creation failed.
PlayMusic 仅客户端
csharp
public static ActorSound? PlayMusic(IGameLink<GameDataActorSound> musicLink, bool fadeOutPrevious = true)Plays background music. Only one music track plays at a time; calling this again will stop the previous music and start the new one.
musicLink— The sound actor data link for the music track.fadeOutPrevious— Whether to fade out the previous music. Defaults to true.
返回: The created ActorSound for the music, or null if creation failed.
StopMusic 仅客户端
csharp
public static void StopMusic(bool fade = true)Stops the currently playing background music.
fade— Whether to fade out instead of stopping abruptly.
PauseMusic 仅客户端
csharp
public static void PauseMusic()Pauses the currently playing background music.
ResumeMusic 仅客户端
csharp
public static void ResumeMusic()Resumes the currently paused background music.
SetMusicVolume 仅客户端
csharp
public static void SetMusicVolume(float volume)Sets the volume of the currently playing background music.
volume— Volume level (0.0 = silent, 1.0 = full volume).
SetCategoryVolume 仅客户端
csharp
public static void SetCategoryVolume(SoundCategory category, float volume)Sets the volume for an entire sound category (e.g., Music, Combat, UI).
category— The sound category to adjust.volume— Volume level (0.0 = silent, 1.0 = full volume).
StopCategory 仅客户端
csharp
public static void StopCategory(SoundCategory category)Stops all sounds in the specified category.
category— The sound category to stop.
UnitBuffExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class UnitBuffExtensionsUnit扩展方法,提供便利的Buff添加功能
方法
AddBuff 仅服务端
csharp
public static Buff? AddBuff(this Unit target, IGameLink<GameDataBuff> buffLink, Unit? caster = null, uint? stack = null, TimeSpan? duration = null)在当前单位上添加Buff(推荐的扩展方法方式)。 此方法会自动创建一个虚拟的EffectBuffAdd效果以记录施法者。
target— 目标单位buffLink— 要添加的Buff数编Linkcaster— 施法者,可选。如果为null,则使用目标单位自身作为施法者stack— 堆叠数量,可选duration— 持续时间,可选
返回: 创建的Buff实例,如果创建失败则返回null
备注
这是 TimeSpan}) 的扩展方法版本,语义等价。 ⚠️ 在技能或效果树中请勿使用此方法,应使用 GameDataEffectBuffAdd 来添加Buff,否则Buff会丢失完整的效果树信息。
UnitDamageExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class UnitDamageExtensionsUnit扩展方法,提供便利的伤害功能
方法
DealDamage 仅服务端
csharp
public static Damage? DealDamage(this Unit target, double amount, IGameLink<GameDataDamageType>? damageType = null, Unit? caster = null, DeathType deathType = DeathType.Normal)对当前单位造成伤害,这个方法会自动创建一个虚拟的EffectDamage效果以记录施法者。 但若要在技能或者效果树中造成伤害,请尽可能使用GameDataEffectDamage来造成伤害,否则伤害会丢失完整的效果树信息。 当前方法应当仅用于在没有效果树环境的情况下直接对单位造成伤害。
target— 目标单位amount— 伤害数值damageType— 伤害类型,可选。如果为null,则使用物理伤害caster— 施法者,可选。如果为null,则使用目标单位自身作为施法者deathType— 致死类型,可选。默认为Normal
返回: 创建的Damage实例,如果创建失败则返回null
UnitHealingExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class UnitHealingExtensionsUnit扩展方法,提供便利的治疗功能
方法
Heal 仅服务端
csharp
public static Healing? Heal(this Unit target, double amount, PropertyVital? vitalProperty = null, Unit? caster = null)对当前单位进行治疗,这个方法会自动创建一个虚拟的EffectUnitModifyVital效果以记录施法者。 但若要在技能或者效果树中进行治疗,请尽可能使用GameDataEffectUnitModifyVital,否则治疗会丢失完整的效果树信息。 当前方法应当仅用于在没有效果树环境的情况下直接对单位进行治疗。
target— 目标单位amount— 治疗数值vitalProperty— 要治疗的活力值类型,可选。如果为null,则治疗生命值caster— 施法者,可选。如果为null,则使用目标单位自身作为施法者
返回: 创建的Healing实例,如果创建失败则返回null
UnitMovementExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class UnitMovementExtensionsTrigger-facing Unit movement controller helper APIs.
方法
GetUnitMovementControllerInfo 双端
csharp
public static IUnitMovementController? GetUnitMovementControllerInfo(this Unit unit)Gets the movement controller interface attached to a Unit, if present.
GetUnitMovementMode 双端
csharp
public static UnitMovementMode GetUnitMovementMode(this Unit unit)Gets the Unit's current effective movement mode, falling back to legacy navigation semantics when no controller exists.
GetUnitMovementSignal 双端
csharp
public static UnitMovementSignal GetUnitMovementSignal(this Unit unit)Gets the latest movement signal for animation, debugging, and low-frequency gameplay queries.
SetUnitMovementMode 双端
csharp
public static bool SetUnitMovementMode(this Unit unit, UnitMovementMode mode)Sets the Unit's requested movement mode, creating a movement controller when needed.
ReturnUnitToSceneNavigation 双端
csharp
public static bool ReturnUnitToSceneNavigation(this Unit unit)Returns the Unit to the navigation movement mode appropriate for its current scene.
ActivateUnitPhysicalCharacterMovement 双端
csharp
public static bool ActivateUnitPhysicalCharacterMovement(this Unit unit, PhysicalCharacterMovementOptions? options = null)Activates physical character movement for a Unit in a 3D scene.
TryJumpUnit 双端
csharp
public static bool TryJumpUnit(this Unit unit, float? launchSpeed = null)Attempts to make the Unit jump through its active physical character movement controller.
SetUnitExtraAirJumpCount 双端
csharp
public static void SetUnitExtraAirJumpCount(this Unit unit, int count)Sets how many additional jumps the Unit may perform while airborne.
GetUnitExtraAirJumpCount 双端
csharp
public static int GetUnitExtraAirJumpCount(this Unit unit)Gets the configured number of additional airborne jumps.
GetUnitRemainingAirJumps 双端
csharp
public static int GetUnitRemainingAirJumps(this Unit unit)Gets the remaining number of additional airborne jumps before the next grounded reset.
CanUnitJump 双端
csharp
public static bool CanUnitJump(this Unit unit)Returns whether a jump request would currently be accepted.
IsUnitMovementGrounded 双端
csharp
public static bool IsUnitMovementGrounded(this Unit unit)Returns whether the Unit's active movement source currently reports grounded.
UnitPropertyExtensions 双端
命名空间 TriggerEncapsulation
csharp
public static class UnitPropertyExtensions单位属性遍历扩展方法集合 提供便利的方法来遍历单位身上的各种属性
方法
GetAllPropertyVitalExtensions 双端
csharp
public static IEnumerable<PropertyVital> GetAllPropertyVitalExtensions()获取所有扩展了PropertyVital的可扩展枚举列表
返回: 所有PropertyVital扩展枚举的列表
GetAllPropertyUnitExtensions 双端
csharp
public static IEnumerable<PropertyUnit> GetAllPropertyUnitExtensions()获取所有扩展了PropertyUnit的可扩展枚举列表
返回: 所有PropertyUnit扩展枚举的列表
EnumerateVitals 双端
csharp
public static IEnumerable<VitalInfo> EnumerateVitals(this Unit unit)遍历单位身上所有的活力值(Vital)
unit— 目标单位
返回: 单位身上所有活力值的信息
EnumeratePropertyUnits 双端
csharp
public static IEnumerable<UnitPropertyInfo> EnumeratePropertyUnits(this Unit unit)遍历单位身上所有的PropertyUnit属性
unit— 目标单位
返回: 单位身上所有PropertyUnit属性的信息,包含泛型Getter
EnumerateUnitPropertyComplexValues 双端
csharp
public static IEnumerable<UnitPropertyComplexInfo> EnumerateUnitPropertyComplexValues(this Unit unit)遍历单位身上所有数值公式属性(UnitPropertyComplex)的最终值
unit— 目标单位
返回: 单位身上所有数值公式属性的最终值信息
GetVital 双端
csharp
public static VitalInfo? GetVital(this Unit unit, PropertyVital vitalType)获取单位身上指定类型的活力值
unit— 目标单位vitalType— 活力值类型
返回: 活力值信息,如果不存在则返回null
GetPropertyUnitValue 双端
csharp
public static T? GetPropertyUnitValue<T>(this Unit unit, PropertyUnit propertyType)获取单位身上指定类型的属性值
unit— 目标单位propertyType— 属性类型
返回: 属性值,如果不存在或类型不匹配则返回default(T)
GetUnitPropertyComplexValue 双端
csharp
public static double GetUnitPropertyComplexValue(this Unit unit, IGameLink<GameDataUnitProperty> propertyLink)获取单位身上指定数值公式属性的最终值
unit— 目标单位propertyLink— 属性链接
返回: 最终值,如果不存在则返回0
Util 双端
命名空间 TriggerEncapsulation
csharp
public static class Util方法
ObjectUserDataSet 双端
csharp
public static void ObjectUserDataSet(object? obj, string key, object value)UserDataSet 双端
csharp
public static void UserDataSet<T>(this T obj, string key, object value) where T : classObjectUserDataGet 双端
csharp
public static object? ObjectUserDataGet(object? obj, string key)UserDataGet 双端
csharp
public static object? UserDataGet<T>(this T obj, string key) where T : classObjectUserDataRemove 双端
csharp
public static bool ObjectUserDataRemove(object? obj, string key)UserDataRemove 双端
csharp
public static bool UserDataRemove<T>(this T obj, string key) where T : classObjectUserDataCopyTo 双端
csharp
public static void ObjectUserDataCopyTo(object? obj, object targetObj)UserDataCopyTo 双端
csharp
public static void UserDataCopyTo<T, V>(this T obj, V targetObj) where T : class where V : classObjectUserDataCapture 双端
csharp
public static Dictionary<string, object> ObjectUserDataCapture(object? obj)UserDataGetAll 双端
csharp
public static Dictionary<string, object>? UserDataGetAll<T>(this T obj) where T : classObjectUserDataClear 双端
csharp
public static void ObjectUserDataClear(object? obj)UserDataClear 双端
csharp
public static void UserDataClear<T>(this T obj) where T : class