private void UpdateActorPos() { UpdateActorPos output = new UpdateActorPos() { RoomId = RoomId, OwnerId = OwnerId, ActorId = ActorId, PosX = PosX, PosZ = PosZ, CellIndex = CellIndex, Orientation = Orientation, }; GameRoomManager.Instance.SendMsg(ROOM.UpdateActorPos, output.ToByteArray()); }
private void OnUpdateActorPos(SocketAsyncEventArgs args, byte[] bytes) { UpdateActorPos input = UpdateActorPos.Parser.ParseFrom(bytes); if (input.RoomId != RoomId) { return; // 不是自己房间的消息,略过 } if (input.CellIndex == 0) { Debug.LogError("RoomLogic OnUpdateActorPos Error - Actor position is lost!"); } var ab = ActorManager.GetActor(input.ActorId); if (ab != null) { ab.PosX = input.PosX; ab.PosZ = input.PosZ; ab.CellIndex = input.CellIndex; ab.Orientation = input.Orientation; } // 这个消息不用返回了 }