diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs index 8b7260964..4d0ebd261 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs @@ -257,6 +257,14 @@ namespace UniGLTF public virtual void ExportAnimations() { + if (Application.isPlaying) + { + // UnityEditor.AnimationUtility などが Editor 専用のため、 + // Editor 時のみ Export できる。 + // !Application.isPlaying ならば Editor であろう。 + return; + } + ReportProgress("Animations", 0.9f); var clips = GetAnimationClips(); @@ -395,11 +403,7 @@ namespace UniGLTF } #endregion -#if UNITY_EDITOR - // 関連する一部の関数が Editor 専用のため、 - // Editor 時のみ Export する。 ExportAnimations(); -#endif ExportExtensions(textureSerializer);