CTT/Server/Hotfix/Module/Numeric/NumericWatcher_SkinId.cs

16 lines
492 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
namespace ET
{
[NumericWatcher(NumericType.SkinId)]
public class NumericWatcher_SkinId : INumericWatcher
{
public async ETTask Run(Entity entity, float old, float value)
{
DelaySendSyncAttributeComponent.instance.Add(entity.As<Unit>(), NumericType.SkinId, value);
User user =await UserComponent.Instance.Query(entity.Id);
user.SkinId = MathHelper.RoundToInt(value);
await ETTask.CompletedTask;
}
}
}