Browse Source

Fix hxd Res

Tom SPIRA 6 năm trước cách đây
mục cha
commit
e35b5cac63
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      hrt/shgraph/ShaderGraph.hx

+ 7 - 1
hrt/shgraph/ShaderGraph.hx

@@ -49,7 +49,13 @@ class ShaderGraph {
 
 		var json : Dynamic;
 		try {
-			var content = hxd.Res.load(this.filepath).toText();
+			var content : String = null;
+			#if editor
+			content = sys.io.File.getContent(hide.Ide.inst.resourceDir + "/" + this.filepath);
+			#else
+			content = hxd.res.Loader.currentInstance.load(this.filepath).toText();
+			//content = hxd.Res.load(this.filepath).toText();
+			#end
 			if (content.length == 0) return;
 			json = haxe.Json.parse(content);
 		} catch( e : Dynamic ) {