コード例 #1
0
 @Override
 public void onDisable(Entity entity) {
   if (entity instanceof EntityModeled) {
     EntityModeled model = (EntityModeled) entity;
     ModelInstance instance = model.getModelInstance();
     if (instance != null && instance.isPlayingAnyAnimations()) {
       instance.getAnimationInstance(0).startPlay();
     }
   }
 }
コード例 #2
0
  @Override
  public void onUpdate(Entity entity) {
    this._move.set(entity.getViewVector());
    this._move.y = 0;
    this._move.normalise();
    this._move.scale(entity.getSpeed());
    entity.move(this._move);

    if (entity instanceof EntityModeled) {
      EntityModeled model = (EntityModeled) entity;
      ModelInstance instance = model.getModelInstance();
      if (instance != null && !instance.isPlayingAnyAnimations()) {
        instance.getAnimationInstance(0).startPlay();
      }
    }
  }