Просмотр исходного кода

[ref] Don't preload references in editor

- Because prefabs aren't cached in editor, this causes a performance
hit in some cases like with the loading of datafiles
Clément Espeute 3 месяцев назад
Родитель
Сommit
cd26cb950e
1 измененных файлов с 3 добавлено и 5 удалено
  1. 3 5
      hrt/prefab/Reference.hx

+ 3 - 5
hrt/prefab/Reference.hx

@@ -76,14 +76,12 @@ class Reference extends Object3D {
 
 		super.load(obj);
 
+		#if !editor
 		if (source != null && shouldBeInstanciated() && hxd.res.Loader.currentInstance.exists(source)) {
-			#if editor
-			// we need the resCache to exist or we'll have an error in Ide.CustomeLoader.loadCache
-			if (@:privateAccess h3d.Engine.getCurrent()?.resCache == null)
-				return;
-			#end
 			initRefInstance();
 		}
+		#end
+
 	}
 
 	override function copy(obj: Prefab) {