NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Buff/Impl/BuffSetSpecialAttackDistanc...

30 lines
837 B
C#
Raw Normal View History

2024-05-17 14:20:53 +08:00
namespace Gameplay.Buff
{
/// <summary>
/// 这个buff是直接修改攻击距离,不同于改变属性是在原有基础上进行增减
/// </summary>
public class BuffSetSpecialAttackDistance : BaseBuff
{
private int _cacheAttackDistance;
protected override void _OnAdd()
{
base._OnAdd();
_cacheAttackDistance = owner.fightData.specialAttackDistance;
var configAttackDistance = _TryGetIntParam(0);
owner.fightData.specialAttackDistance = configAttackDistance;
owner.controlData.forceUpdateTarget = true;
2024-05-17 14:20:53 +08:00
}
protected override void _OnRemove()
{
base._OnRemove();
owner.fightData.specialAttackDistance = _cacheAttackDistance;
}
}
}