public void Move(Racing3DGameModel.MoveDirections direction) { if ((direction == Racing3DGameModel.MoveDirections.Left && CurrentRoadLine < 1) || (direction == Racing3DGameModel.MoveDirections.Right && CurrentRoadLine >= maxRoadLine)) { return; } int newRoadLine = direction == Racing3DGameModel.MoveDirections.Left ? CurrentRoadLine - 1 : CurrentRoadLine + 1; if (gameControl.OpponentCar.CurrentRoadLine == newRoadLine) { if (Mathf.Abs(transform.position.y - gameControl.OpponentCar.transform.position.y) <= 0.9f) { return; } } if (direction == Racing3DGameModel.MoveDirections.Left) { CurrentRoadLine--; rb.position -= new Vector3(moveDistance, 0f, 0f); } else { CurrentRoadLine++; rb.position += new Vector3(moveDistance, 0f, 0f); } if (Controllable) { gameControl.SendMoveMessage(direction); } }
private void Move(Racing3DCarControl car, Racing3DGameModel.MoveDirections direction) { if (!car.Controllable) { return; } car.Move(direction); }
public void SendMoveMessage(Racing3DGameModel.MoveDirections direction) { if (model == null || opponentId == null) { return; } GameServices.RealTime.SendMessage(move, opponentId, model.CreateMoveMessage(direction)); }
private void Move(Racing3DCarControl car, Racing3DGameModel.MoveDirections direction) { }
public void Move(Racing3DGameModel.MoveDirections direction) { }
public void SendMoveMessage(Racing3DGameModel.MoveDirections direction) { }
public byte[] CreateMoveMessage(Racing3DGameModel.MoveDirections direction) { return(null); }