Parcourir la source

added clear()

Nicolas Cannasse il y a 5 ans
Parent
commit
26db693f7f
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      h3d/scene/Trail.hx

+ 5 - 1
h3d/scene/Trail.hx

@@ -49,6 +49,10 @@ class Trail extends Mesh {
 		return p;
 	}
 
+	public function clear() {
+		if( points.length > 0 ) points = [];
+	}
+
 	public function save() : Dynamic {
 		return {
 			duration : duration,
@@ -88,7 +92,7 @@ class Trail extends Mesh {
 
 	override function sync(ctx) {
 		super.sync(ctx);
-		if(ctx.elapsedTime == 0)
+		if( ctx.elapsedTime == 0 || (!ctx.visibleFlag && !alwaysSync) )
 			return;
 
 		var curX = absPos._41;