コード例 #1
0
  @Override
  public void cleanup() {
    super.cleanup();

    for (AbstractShipMarkerControl control : shipControls) {
      control.setEnabled(false);
      Spatial spatial = control.getSpatial();

      if (spatial != null) {
        spatial.removeControl(control);
      }
    }

    shipControls.clear();
  }
コード例 #2
0
  private void respawn(RespawnPlayerEvent event) {
    final Player player = event.getPlayer();

    if (player.isLocalPlayer()) {
      enqueueHelper.enqueue(
          new Callable<Void>() {
            @Override
            public Void call() throws Exception {
              setEnabled(true);
              panShipStatus.setShieldsPercentage(1f);
              panShipStatus.setHitPointsPercentage(1f);
              return null;
            }
          });
    } else {
      final Node ship = player.getShip();

      enqueueHelper.enqueue(
          new Callable<Void>() {
            @Override
            public Void call() throws Exception {
              HUDMarkerControl markerControl = getMarkerControl(ship, player);
              markerControl.setEnabled(true);

              HUDArrowControl arrowControl = getArrowControl(ship, player);
              arrowControl.setEnabled(true);

              return null;
            }
          });
    }

    for (AbstractShipMarkerControl control : shipControls) {
      control.onRespawnPlayer(event);
    }
  }