|
@@ -51,10 +51,14 @@ class FX2DAnimation extends h2d.Object {
|
|
}
|
|
}
|
|
|
|
|
|
public function setTime( time : Float ) {
|
|
public function setTime( time : Float ) {
|
|
- this.localTime = time;
|
|
|
|
|
|
+
|
|
|
|
+ var newLoop = false;
|
|
|
|
+
|
|
|
|
+ if (loop && this.localTime > time)
|
|
|
|
+ newLoop = true;
|
|
|
|
|
|
- if (loop)
|
|
|
|
- time = this.localTime % duration;
|
|
|
|
|
|
+ this.localTime = time;
|
|
|
|
+
|
|
for(anim in objects) {
|
|
for(anim in objects) {
|
|
if(anim.scale != null) {
|
|
if(anim.scale != null) {
|
|
var scale = evaluator.getVector(anim.scale, time);
|
|
var scale = evaluator.getVector(anim.scale, time);
|
|
@@ -86,6 +90,20 @@ class FX2DAnimation extends h2d.Object {
|
|
drawable.color = evaluator.getVector(anim.color, time);
|
|
drawable.color = evaluator.getVector(anim.color, time);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ var atlas = Std.downcast(anim.elt2d, hrt.prefab.Atlas);
|
|
|
|
+ if (atlas != null) {
|
|
|
|
+ @:privateAccess if (!atlas.loop && newLoop) {
|
|
|
|
+ atlas.h2dAnim.currentFrame = 0;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ var atlas = Std.downcast(anim.elt2d, hrt.prefab.Anim2D);
|
|
|
|
+ if (atlas != null) {
|
|
|
|
+ @:privateAccess if (!atlas.loop && newLoop) {
|
|
|
|
+ atlas.h2dAnim.currentFrame = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
if(anim.events != null) {
|
|
if(anim.events != null) {
|
|
for(evt in anim.events) {
|
|
for(evt in anim.events) {
|
|
@@ -190,6 +208,9 @@ class FX2D extends BaseFX {
|
|
anyFound = true;
|
|
anyFound = true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (Std.is(elt, hrt.prefab.Anim2D) || Std.is(elt, hrt.prefab.Atlas))
|
|
|
|
+ anyFound = true;
|
|
|
|
+
|
|
if(anyFound)
|
|
if(anyFound)
|
|
anims.push(anim);
|
|
anims.push(anim);
|
|
}
|
|
}
|