Skip to content

Commit 65e1538

Browse files
authored
Prefab cache fix (#434)
* fix prefab cache * fix prefab cache
1 parent 380154d commit 65e1538

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

  • runtimes/talos/src/main/java/com/talosvfx/talos/runtime/scene

runtimes/talos/src/main/java/com/talosvfx/talos/runtime/scene/Prefab.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
import com.badlogic.gdx.utils.Json;
55
import com.badlogic.gdx.utils.JsonReader;
66
import com.badlogic.gdx.utils.JsonValue;
7-
import com.talosvfx.talos.runtime.utils.TempHackUtil;
87

98
public class Prefab extends SavableContainer {
109
public static String PREFIX = "Prefab_";
1110

1211
public transient String name;
1312
private transient String talosIdentifier;
14-
public transient String cachedJsonString;
13+
public transient String cachedRootGoJson;
1514

1615
public Prefab () {
1716
}
@@ -21,14 +20,6 @@ public Prefab (String jsonContent, String name) {
2120
setName(name);
2221
}
2322

24-
@Override
25-
void loadFromString (String jsonString) {
26-
String hackedString = TempHackUtil.hackIt(jsonString);
27-
this.cachedJsonString = hackedString;
28-
29-
load(hackedString);
30-
}
31-
3223
public Prefab(GameObject root) {
3324
this.root = root;
3425
}
@@ -48,7 +39,7 @@ public void load(String data) {
4839
root = json.readValue(GameObject.class, jsonRoot);
4940
root.setGameObjectContainer(this);
5041

51-
//Lets add a fake root
42+
cachedRootGoJson = json.toJson(root, GameObject.class);
5243
}
5344

5445
@Override

0 commit comments

Comments
 (0)