浏览代码

Allow recursive Object.stopAnimation

trethaller 7 年之前
父节点
当前提交
c01d2d1bd3
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      h3d/scene/Object.hx

+ 5 - 1
h3d/scene/Object.hx

@@ -145,8 +145,12 @@ class Object implements hxd.impl.Serializable {
 		return currentAnimation = a;
 	}
 
-	public function stopAnimation() {
+	public function stopAnimation( ?recursive = false ) {
 		currentAnimation = null;
+		if(recursive) {
+			for(c in children)
+				c.stopAnimation(true);
+		}
 	}
 
 	/**