public void MsgHandle(List <Packet> list) { for (int i = 0; i < list.Count; i++) { int packId = list[i].Id; Packet framePacket = list[i]; switch (packId) { case 1006: StartMoveReq startMoveReq = (StartMoveReq)framePacket; Process(startMoveReq); break; case 1008: ChangeDirReq changeDirReq = (ChangeDirReq)framePacket; Process(changeDirReq); break; case 1010: EndMoveReq endMoveReq = (EndMoveReq)framePacket; Process(endMoveReq); break; //case 1016: // TransformReq transformReq = (TransformReq)framePacket; // Process(transformReq); // break; } } }
public static void SendEndMove() { EndMoveReq mEndMoveReq = new EndMoveReq(); mEndMoveReq.UserId = "" + GameEntry.NetData.mUserData.UserId; mEndMoveReq.RoomId = GameEntry.NetData.mFightData.RoomId; Send(mEndMoveReq); }
private void Process(EndMoveReq endMoveReq) { // EndMoveReq handle string userId = endMoveReq.UserId; Tank tank = GameEntry.LockManager.GetActor(userId); tank.GetComponentInChildren <Thruster>().X = 0; tank.GetComponentInChildren <Thruster>().Y = 0; }