移动同步相关
This commit is contained in:
@@ -9,7 +9,14 @@ public class C2Map_MoveHandler : Route<MapUnit, C2Map_Move>
|
||||
{
|
||||
protected override async FTask Run(MapUnit entity, C2Map_Move message)
|
||||
{
|
||||
var mapUnitManageComponent = entity.Scene.GetComponent<MapUnitManageComponent>();
|
||||
var roomManageComponent = entity.Scene.GetComponent<RoomManageComponent>();
|
||||
var roomId = entity.RoomId;
|
||||
var room = roomManageComponent.Get(roomId);
|
||||
if (room == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// var mapUnitManageComponent = entity.Scene.GetComponent<MapUnitManageComponent>();
|
||||
var notifyMessage = new Map2C_MoveNotify()
|
||||
{
|
||||
Id = entity.Id,
|
||||
@@ -28,10 +35,11 @@ public class C2Map_MoveHandler : Route<MapUnit, C2Map_Move>
|
||||
entity.Rotation.y = message.Rotation.y;
|
||||
entity.Rotation.z = message.Rotation.z;
|
||||
|
||||
foreach (var (_, unit) in mapUnitManageComponent.Units)
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage);
|
||||
}
|
||||
|
||||
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user