浏览代码

added initTile

Nicolas Cannasse 5 年之前
父节点
当前提交
8e93771716
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 9 5
      hrt/prefab/l3d/HeightMap.hx

+ 9 - 5
hrt/prefab/l3d/HeightMap.hx

@@ -289,14 +289,18 @@ class HeightMapMesh extends h3d.scene.Object {
 		}
 		if( t.root != null )
 			t.root.visible = true;
-		else {
-			t.create(this);
-			addChild(t.root);
-			onTileReady(t);
-		}
+		else
+			initTile(t);
 		return true;
 	}
 
+	public function initTile( t : HeightMapTile ) {
+		if( t.root != null ) return;
+		t.create(this);
+		addChild(t.root);
+		onTileReady(t);
+	}
+
 	public function init() {
 		var htex = hmap.getTextures(Height, 0, 0)[0];
 		var size = hmap.size;