namespace Gameplay.Buff { /// /// 这个buff是直接修改攻击距离,不同于改变属性是在原有基础上进行增减 /// 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; } protected override void _OnRemove() { base._OnRemove(); owner.fightData.specialAttackDistance = _cacheAttackDistance; } } }