2
我只是想知道,如何製作一次性動畫。我有很多動畫,但不幸的是,他們在循環中重複着,這不是我想要的。這裏有一些代碼片段:如何製作一次性動畫?
public void act(float delta) {
super.act(delta);
stateTime += Gdx.graphics.getDeltaTime();
TextureRegion currentFrame = activeAnimation.getKeyFrame(stateTime, true);
setDrawable(new TextureRegionDrawable(currentFrame));
}
RUNNING_ANIMATION_BY_SIDE = new Animation<TextureRegion>(0.333f,framesRunningBySide,Animation.PlayMode.LOOP);
SHOOTING_ANIMATION = new Animation<TextureRegion>(0.333f, framesShootingFront, Animation.PlayMode.NORMAL);
STEADY_ANIMATION = new Animation<TextureRegion>(0.230f, framesStandingFront, Animation.PlayMode.LOOP_RANDOM);
DYING_ANIMATION = new Animation<TextureRegion>(0.230f, framesDyingFront,Animation.PlayMode.NORMAL);
setActiveAnimation(STEADY_ANIMATION);
如何讓我的演員只播放一次動畫?如您所見,我已設置爲DYING_ANIMATION a PlayMode.NORMAL。