Skip to content

Commit 216ae7a

Browse files
committed
Fix for editor-time exporting
1 parent 1e1ad62 commit 216ae7a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Runtime/Scripts/Interactivity/Playback/Context/Export/InteractivityExportContext.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ public override void AfterSceneExport(GLTFSceneExporter exporter, GLTFRoot gltfR
5353
return;
5454

5555
exporter.DeclareExtensionUsage(InteractivityGraphExtension.EXTENSION_NAME, true);
56-
gltfRoot.AddExtension(InteractivityGraphExtension.EXTENSION_NAME, new InteractivityGraphExtension(playback.extensionData));
56+
57+
var extensionData = playback.extensionData;
58+
59+
if(extensionData == null && playback.gameObject.TryGetComponent(out GLTFInteractivityData data))
60+
{
61+
var serializer = new GraphSerializer();
62+
extensionData = serializer.Deserialize(data.interactivityJson);
63+
}
64+
65+
gltfRoot.AddExtension(InteractivityGraphExtension.EXTENSION_NAME, new InteractivityGraphExtension(extensionData));
5766
}
5867
public override void AfterTextureExport(GLTFSceneExporter exporter, GLTFSceneExporter.UniqueTexture texture, int index, GLTFTexture tex)
5968
{

0 commit comments

Comments
 (0)