Fixed issue where effect and audio tracks were looping even if they shouldn't

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10429 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent 0a90ff21d2
commit 304878c712
  1. 3
      engine/src/core/com/jme3/animation/AudioTrack.java
  2. 2
      engine/src/core/com/jme3/animation/EffectTrack.java

@ -68,6 +68,7 @@ public class AudioTrack implements ClonableTrack {
private float length = 0;
private boolean initialized = false;
private boolean started = false;
private boolean played = false;
//Animation listener to stop the sound when the animation ends or is changed
private class OnEndListener implements AnimEventListener {
@ -121,7 +122,7 @@ public class AudioTrack implements ClonableTrack {
*/
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
if (time == length) {
if (time >= length) {
return;
}
if (!initialized) {

@ -192,7 +192,7 @@ public class EffectTrack implements ClonableTrack {
*/
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
if (time == length) {
if (time >= length) {
return;
}
//first time adding the Animation listener to stop the track at the end of the animation

Loading…
Cancel
Save