Browse Source

Reference: prevent override local2d + sceneEditor: fix resetCamera 3D

Tom SPIRA 5 years ago
parent
commit
fc5f95fc63
1 changed files with 9 additions and 7 deletions
  1. 9 7
      hrt/prefab/Reference.hx

+ 9 - 7
hrt/prefab/Reference.hx

@@ -82,13 +82,15 @@ class Reference extends Object3D {
 			p.make(ctx);
 
 			#if editor
-			var path = hide.Ide.inst.appPath + "/res/icons/fileRef.png";
-			var data = sys.io.File.getBytes(path);
-			var tile = hxd.res.Any.fromBytes(path, data).toTile().center();
-			var objFollow = new h2d.ObjectFollower(ctx.local3d, ctx.shared.root2d);
-			objFollow.followVisibility = true;
-			var bmp = new h2d.Bitmap(tile, objFollow);
-			ctx.local2d = objFollow;
+			if (ctx.local2d == null) {
+				var path = hide.Ide.inst.appPath + "/res/icons/fileRef.png";
+				var data = sys.io.File.getBytes(path);
+				var tile = hxd.res.Any.fromBytes(path, data).toTile().center();
+				var objFollow = new h2d.ObjectFollower(ctx.local3d, ctx.shared.root2d);
+				objFollow.followVisibility = true;
+				var bmp = new h2d.Bitmap(tile, objFollow);
+				ctx.local2d = objFollow;
+			}
 			#end
 
 		}