2
0
trethaller 7 жил өмнө
parent
commit
3706086da2
1 өөрчлөгдсөн 6 нэмэгдсэн , 2 устгасан
  1. 6 2
      hxd/prefab/Prefab.hx

+ 6 - 2
hxd/prefab/Prefab.hx

@@ -144,8 +144,7 @@ class Prefab {
 		p.name = v.name;
 		if(v.enabled != null)
 			p.enabled = v.enabled;
-		if(v.props != null)
-			p.props = Reflect.copy(v.props);  // TODO: Recursive?
+		p.props = v.props;
 		if( v.source != null )
 			p.source = v.source;
 		p.load(v);
@@ -273,4 +272,9 @@ class Prefab {
 		}
 		return type.split(".").pop();
 	}
+
+	public function clone() : Prefab {
+		var obj = saveRec();
+		return loadRec(haxe.Json.parse(haxe.Json.stringify(obj)));
+	}
 }