33 lines
964 B
C#
33 lines
964 B
C#
using Fantasy;
|
|
using Fantasy.Async;
|
|
using Fantasy.Network.Interface;
|
|
|
|
namespace NB.Map;
|
|
|
|
public class C2Map_LookHandler : Route<MapUnit, C2Map_Look>
|
|
{
|
|
protected override async FTask Run(MapUnit entity, C2Map_Look message)
|
|
{
|
|
var roomManageComponent = entity.Scene.GetComponent<RoomManageComponent>();
|
|
var notifyMessage = new Map2C_LookeNotify()
|
|
{
|
|
Id = entity.Id,
|
|
Rotation = message.Rotation,
|
|
Timestamp = message.Timestamp
|
|
};
|
|
|
|
entity.Rotation.x = message.Rotation.x;
|
|
entity.Rotation.y = message.Rotation.y;
|
|
entity.Rotation.z = message.Rotation.z;
|
|
|
|
var room = roomManageComponent.Get(entity.MapId);
|
|
|
|
|
|
// foreach (var (_, unit) in mapUnitManageComponent.Units)
|
|
// {
|
|
// entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage);
|
|
// }
|
|
|
|
await FTask.CompletedTask;
|
|
}
|
|
} |