allow components off root, but only allow one or error

This commit is contained in:
Lillith Rose 2026-01-07 16:52:44 -05:00
parent a49d2d74e6
commit 1f779f9297
18 changed files with 133 additions and 12 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using gay.lilyy.Common;
using gay.lilyy.MenuIconReplacer;
using nadena.dev.ndmf;
using nadena.dev.ndmf.vrchat;
@ -21,7 +22,7 @@ namespace gay.lilyy.MenuIconReplacer
{
InPhase(BuildPhase.Optimizing).BeforePlugin("gay.lilyy.MenuIconRemover").Run("ReplaceMenuIcons", ctx =>
{
var obj = ctx.AvatarRootObject.GetComponent<MenuIconReplacerConfig>();
var obj = ComponentHelper.GetComponentInChildrenWithError<MenuIconReplacerConfig>(ctx.AvatarRootObject);
if (obj != null)
{
var descriptor = ctx.VRChatAvatarDescriptor();