2021-04-08 20:09:59 +08:00
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
[NumericWatcher(NumericType.Spd)]
|
|
|
|
|
public class NumericWatcher_Spd : INumericWatcher
|
|
|
|
|
{
|
|
|
|
|
public async ETTask Run(Entity entity, float old, float value)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
Unit unit = entity.As<Unit>();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
UserSetting setting = unit.GetComponent<UserSetting>();
|
2021-04-11 19:50:39 +08:00
|
|
|
|
NumericComponent num = unit.GetComponent<NumericComponent>();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (setting!=null)
|
|
|
|
|
setting.SetCD(MathHelper.RoundToInt(CharacterHelper.GetSkillCD(num.Get(NumericType.Spd))));
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|