From 2ad706b3f52b52a3665e2be0507c6d4f9a314263 Mon Sep 17 00:00:00 2001 From: Koarare Date: Tue, 29 Nov 2022 13:34:13 +0900 Subject: [PATCH] Search all children of the armature when running setup outfit (#108) https://github.com/bdunderscore/modular-avatar/issues/101 Closes: #101 --- .../nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs b/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs index 79ac82be..646fd19c 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs @@ -65,11 +65,11 @@ namespace nadena.dev.modular_avatar.core.editor // Heuristic search - usually there'll be root -> Armature -> (single child) Hips foreach (Transform child in outfitRoot.transform) { - if (child.childCount == 1) + foreach (Transform tempHip in child) { - if (child.GetChild(0).name.Contains(avatarHips.name)) + if (tempHip.name.Contains(avatarHips.name)) { - outfitHips = child.GetChild(0).gameObject; + outfitHips = tempHip.gameObject; } } }