zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/HotfixView/Numeric/NumericWatcher_Title.cs

19 lines
555 B
C#

using ET;
namespace ET
{
[NumericWatcher(NumericType.Title)]
public class NumericWatcher_Title : INumericWatcher
{
public async ETTask Run(Entity entity, float old, float value)
{
Log.Info($"@{entity.Id}改变 Title:{old} -> {value}");
Unit unit = entity.As<Unit>();
var zoneScene = entity.ZoneScene();
int titleId = MathHelper.RoundToInt(value);
CharacterUIHelper.ChangeTitle(zoneScene,entity, titleId);
await ETTask.CompletedTask;
}
}
}