From 1f8a116d3a50ceba2470a88912d4890f43f48b86 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 22 Feb 2022 17:52:24 +0900 Subject: [PATCH] remove #if UNITY_EDITOR --- Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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);