From 11bf5e32d0ded1f2168274634478dba069f82f95 Mon Sep 17 00:00:00 2001 From: bd_ Date: Sat, 7 Oct 2023 10:23:38 +0900 Subject: [PATCH] fix: unknown error from ESO when avatar descriptor is not found (#472) --- .../nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs | 9 +++++++++ .../Editor/Localization/en.json | 2 +- .../Editor/Localization/ja.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs b/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs index 38b0c607..2bacb587 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs @@ -310,6 +310,15 @@ namespace nadena.dev.modular_avatar.core.editor avatarRoot = outfitRoot != null ? RuntimeUtil.FindAvatarInParents(outfitRoot.transform)?.gameObject : null; + + if (avatarRoot == null) + { + errorMessageGroups = new string[] + { + S_f("setup_outfit.err.no_avatar_descriptor", outfitRoot != null ? outfitRoot.name : "") + }; + } + if (outfitRoot == null || avatarRoot == null) return false; var avatarAnimator = avatarRoot.GetComponent(); diff --git a/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json b/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json index bf884494..b7309281 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json +++ b/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json @@ -168,7 +168,7 @@ "setup_outfit.err.unknown": "Unknown error", "setup_outfit.err.no_selection": "No object selected.", "setup_outfit.err.multiple_avatar_descriptors": "Multiple avatar descriptors found in {0} and its parents.", - "setup_outfit.err.no_avatar_descriptor": "No avatar descriptor found in {0} or its parents.", + "setup_outfit.err.no_avatar_descriptor": "No avatar descriptor found in {0}'s parents. Make sure your outfit is placed inside your avatar.", "setup_outfit.err.no_animator": "Your avatar does not have an Animator component.", "setup_outfit.err.no_hips": "Your avatar does not have a Hips bone. Setup Outfit only works on humanoid avatars.", "setup_outfit.err.no_outfit_hips": "Unable to identify the Hips object for the outfit. Searched for objects containing the following names:", diff --git a/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json b/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json index bc824424..dcc42e1a 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json +++ b/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json @@ -165,7 +165,7 @@ "setup_outfit.err.unknown": "原因不明のエラーが発生しました。", "setup_outfit.err.no_selection": "オブジェクトが選択されていません。", "setup_outfit.err.multiple_avatar_descriptors": "「{}」とその親に、複数のavatar descriptorを発見しました。", - "setup_outfit.err.no_avatar_descriptor": "「{}」とその親に、avatar descriptorが見つかりませんでした。", + "setup_outfit.err.no_avatar_descriptor": "「{0}」の親に、avatar descriptorが見つかりませんでした。衣装のオブジェクトをアバターの中に配置してください。", "setup_outfit.err.no_animator": "アバターにAnimatorコンポーネントがありません。", "setup_outfit.err.no_hips": "アバターにHipsボーンがありません。なお、Setup Outfitはヒューマノイドアバター以外には対応していません。", "setup_outfit.err.no_outfit_hips": "衣装のHipsボーンを発見できませんでした。以下の名前を含むボーンを探しました:",