浏览代码

L3D: Fix resolution of instance models paths

trethaller 6 年之前
父节点
当前提交
3bff183733
共有 1 个文件被更改,包括 16 次插入18 次删除
  1. 16 18
      hide/prefab/l3d/Instance.hx

+ 16 - 18
hide/prefab/l3d/Instance.hx

@@ -92,25 +92,23 @@ class Instance extends Object3D {
 			}
 			return null;
 		}
-		var col = refSheet.columns.find(c -> c.type == cdb.Data.ColumnType.TFile);
 		var path = null;
-		if(col != null) {
-			path = filter(Reflect.getProperty(obj, col.name));
-		}
-		if(path == null) {
-			for(c in refSheet.columns) {
-				if(c.type == cdb.Data.ColumnType.TList) {
-					var sub = refSheet.getSub(c);
-					if(sub == null) continue;
-					var lines : Array<Dynamic> = Reflect.field(obj, c.name);
-					if(lines == null || lines.length == 0) continue;
-					// var lines = sub.getLines();
-					// if(lines.length == 0) continue;
-					var col = sub.columns.find(sc -> sc.type == cdb.Data.ColumnType.TFile);
-					if(col == null) continue;
-					path = filter(Reflect.getProperty(lines[0], col.name));
-					if(path != null) break;
-				}
+		for(c in refSheet.columns) {
+			if(c.type == cdb.Data.ColumnType.TList) {
+				var sub = refSheet.getSub(c);
+				if(sub == null) continue;
+				var lines : Array<Dynamic> = Reflect.field(obj, c.name);
+				if(lines == null || lines.length == 0) continue;
+				// var lines = sub.getLines();
+				// if(lines.length == 0) continue;
+				var col = sub.columns.find(sc -> sc.type == cdb.Data.ColumnType.TFile);
+				if(col == null) continue;
+				path = filter(Reflect.getProperty(lines[0], col.name));
+				if(path != null) break;
+			}
+			else if(c.type == cdb.Data.ColumnType.TFile) {
+				path = filter(Reflect.getProperty(obj, c.name));
+				if(path != null) break;
 			}
 		}
 		return path;