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; }
//private void Process(TransformReq transformReq) { // // transformReq handle // string userId = transformReq.UserId; // Tank tank = GameEntry.LockManager.GetActor(userId); // if (tank != null) { // tank.updateTransform = true; // // 每一帧刷新tank坐标和朝向 // tank.PositionX = transformReq.PositionX; // tank.PositionZ = transformReq.PositionZ; // tank.RotationY = transformReq.RotationY; // } //} private void Process(StartMoveReq startMoveReq) { // StartMoveReq handle string userId = startMoveReq.UserId; Tank tank = GameEntry.LockManager.GetActor(userId); if (tank != null) { tank.GetComponentInChildren <Thruster>().X = 0; tank.GetComponentInChildren <Thruster>().Y = 0; } }
private void Process(ChangeDirReq changeDirReq) { // ChangeDirReq handle string userId = changeDirReq.UserId; Tank tank = GameEntry.LockManager.GetActor(userId); if (tank != null) { tank.GetComponentInChildren <Thruster>().X = changeDirReq.DirX; tank.GetComponentInChildren <Thruster>().Y = changeDirReq.DirY; } }