From 1016aa6cd3a70e34bff093f84eca0386c867ce33 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 25 Feb 2023 01:13:22 +0900 Subject: [PATCH] chore: add warning if MergeSkinnedMesh is applied to SkinnedMeshRenderer with Mesh --- Editor/MergeSkinnedMeshEditor.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Editor/MergeSkinnedMeshEditor.cs b/Editor/MergeSkinnedMeshEditor.cs index 6570e1dee..7c9404c03 100644 --- a/Editor/MergeSkinnedMeshEditor.cs +++ b/Editor/MergeSkinnedMeshEditor.cs @@ -27,6 +27,13 @@ private static class Style public override void OnInspectorGUI() { + if (((MergeSkinnedMesh)target).GetComponent().sharedMesh) + { + GUILayout.Label($"Mesh of SkinnedMeshRenderer is not None!", Style.WarningStyle); + GUILayout.Label($"You should add MergeSkinnedMesh onto new GameObject with new SkinnedMeshRenderer!", + Style.WarningStyle); + } + var renderersProp = serializedObject.FindProperty("renderers"); var staticRenderersProp = serializedObject.FindProperty("staticRenderers");