mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
25 lines
800 B
C#
25 lines
800 B
C#
namespace ET.Client
|
|
{
|
|
[ActorMessageHandler(SceneType.LockStep)]
|
|
public class Room2C_AdjustUpdateTimeHandler: ActorMessageHandler<Scene, Room2C_AdjustUpdateTime>
|
|
{
|
|
protected override async ETTask Run(Scene root, Room2C_AdjustUpdateTime message)
|
|
{
|
|
Room room = root.GetComponent<Room>();
|
|
int newInterval = (1000 + (message.DiffTime - LSConstValue.UpdateInterval)) * LSConstValue.UpdateInterval / 1000;
|
|
|
|
if (newInterval < 40)
|
|
{
|
|
newInterval = 40;
|
|
}
|
|
|
|
if (newInterval > 66)
|
|
{
|
|
newInterval = 66;
|
|
}
|
|
|
|
room.FixedTimeCounter.ChangeInterval(newInterval, room.PredictionFrame);
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
} |