浏览代码

Model: add file path in error log when model can't be loaded

lviguier 8 月之前
父节点
当前提交
ed9d67898b
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      hrt/prefab/Model.hx

+ 7 - 1
hrt/prefab/Model.hx

@@ -26,7 +26,13 @@ class Model extends Object3D {
 		#if editor
 		try {
 		#end
-			var obj = shared.loadModel(source);
+			var obj : h3d.scene.Object;
+			try {
+				obj = shared.loadModel(source);
+			} catch(e : hxd.res.NotFound) {
+				throw 'Could not load model $source needed in ${shared.currentPath} \n\n ${e}';
+			}
+
 			if(obj.defaultTransform != null && children.length > 0) {
 				obj.name = "root";
 				var root = new h3d.scene.Object();