浏览代码

added partial load to loadPrefab

Nicolas Cannasse 4 年之前
父节点
当前提交
6bd5ea4923
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      h3d/prim/ModelCache.hx

+ 3 - 2
h3d/prim/ModelCache.hx

@@ -121,8 +121,9 @@ class ModelCache {
 
 	#if hide
 
-	public function loadPrefab( res : hxd.res.Prefab, ?parent : h3d.scene.Object ) {
-		var p = res.load();
+	public function loadPrefab( res : hxd.res.Prefab, ?p : hrt.prefab.Prefab, ?parent : h3d.scene.Object ) {
+		if( p == null )
+			p = res.load();
 		var ctx = new hrt.prefab.Context();
 		ctx.init(res);
 		@:privateAccess ctx.shared.cache = this;