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
This commit is contained in:
rem..om 2013-02-25 09:23:36 +00:00
parent 0a90ff21d2
commit 304878c712
2 changed files with 3 additions and 2 deletions

View File

@ -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) {

View File

@ -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