From 877c40f87f29fdf2b45374ca4e584728af2e9373 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 12 Aug 2020 17:11:00 +0900 Subject: [PATCH] prefab check --- Assets/VRM/UniVRM/Editor/Format/VRMExporterWizard.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/VRM/UniVRM/Editor/Format/VRMExporterWizard.cs b/Assets/VRM/UniVRM/Editor/Format/VRMExporterWizard.cs index 24ab2c990..91ae5b9b1 100644 --- a/Assets/VRM/UniVRM/Editor/Format/VRMExporterWizard.cs +++ b/Assets/VRM/UniVRM/Editor/Format/VRMExporterWizard.cs @@ -349,6 +349,10 @@ namespace VRM var root = (GameObject)EditorGUILayout.ObjectField(ExportRoot, typeof(GameObject), true); UpdateRoot(root); + // + // ここでも validate している。ここで失敗して return した場合は Export UI を表示しない + // + // // root // @@ -367,6 +371,12 @@ namespace VRM Validation.Error("ExportRootに回転・拡大縮小は持てません。子階層で回転・拡大縮小してください").DrawGUI(); return; } + if (AssetDatabase.GetAssetPath(root) != null) + { + // is prefab + Validation.Error("シーンに出していない Prefab はエクスポートできません(細かい挙動が違い、想定外の動作をところがあるため)。シーンに展開してからエクスポートしてください").DrawGUI(); + return; + } if (HasRotationOrScale(ExportRoot)) { if (m_settings.PoseFreeze) @@ -696,3 +706,4 @@ namespace VRM } } } +