Fixed a bug where if you started a new animation from the animation complete callback of another animation no event was triggered at the end of the new animation.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10516 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
b5014c5fbc
commit
9c91d8c8e1
@ -263,6 +263,7 @@ public final class AnimChannel {
|
|||||||
time = 0;
|
time = 0;
|
||||||
speed = 1f;
|
speed = 1f;
|
||||||
loopMode = LoopMode.Loop;
|
loopMode = LoopMode.Loop;
|
||||||
|
System.out.println("Setting notified false");
|
||||||
notified = false;
|
notified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,6 +363,7 @@ public final class AnimChannel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
animation = null;
|
animation = null;
|
||||||
|
System.out.println("Setting notified false");
|
||||||
notified = false;
|
notified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,10 +398,13 @@ public final class AnimChannel {
|
|||||||
|
|
||||||
if (animation.getLength() > 0){
|
if (animation.getLength() > 0){
|
||||||
if (!notified && (time >= animation.getLength() || time < 0)) {
|
if (!notified && (time >= animation.getLength() || time < 0)) {
|
||||||
control.notifyAnimCycleDone(this, animation.getName());
|
|
||||||
if (loopMode == LoopMode.DontLoop) {
|
if (loopMode == LoopMode.DontLoop) {
|
||||||
|
// Note that this flag has to be set before calling the notify
|
||||||
|
// since the notify may start a new animation and then unset
|
||||||
|
// the flag.
|
||||||
notified = true;
|
notified = true;
|
||||||
}
|
}
|
||||||
|
control.notifyAnimCycleDone(this, animation.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user