Skip to content

Commit 77f6268

Browse files
committed
fixed AudioExport plugin -no script found- for builds
1 parent 9a33156 commit 77f6268

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Runtime/Scripts/Plugins/Experimental/AudioExport.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,31 @@
66

77
#if UNITY_EDITOR
88
using UnityEditor;
9+
#endif
910

1011
namespace UnityGLTF.Plugins
1112
{
1213
[NonRatifiedPlugin]
1314
public class AudioExport: GLTFExportPlugin
1415
{
16+
#if !UNITY_EDITOR
17+
public override bool Enabled => false;
18+
#endif
1519
public override bool EnabledByDefault => false;
1620
public override string DisplayName => "KHR_audio_emitter";
1721
public override string Description => "Exports positional and global audio sources. Only exporting from the editor is supported at this time.";
1822
public override GLTFExportPluginContext CreateInstance(ExportContext context)
1923
{
24+
#if UNITY_EDITOR
2025
return new AudioExportContext(context);
26+
#else
27+
Debug.LogWarning("Audio export is only supported in the Unity Editor.");
28+
return null;
29+
#endif
2130
}
2231
}
2332

33+
#if UNITY_EDITOR
2434
public class AudioExportContext: GLTFExportPluginContext
2535
{
2636
private List<AudioDescription> _audioSourceIds = new();
@@ -220,5 +230,5 @@ public override void AfterSceneExport(GLTFSceneExporter exporter, GLTFRoot gltfR
220230
gltfRoot.Scenes[0].AddExtension(KHR_SceneAudioEmittersRef.ExtensionName, _sceneExtension);
221231
}
222232
}
233+
#endif
223234
}
224-
#endif

0 commit comments

Comments
 (0)