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,3 +1,4 @@
using gay.lilyy.Common;
using gay.lilyy.MeshCompression;
using nadena.dev.ndmf;
using UnityEditor;
@ -29,7 +30,7 @@ namespace gay.lilyy.MeshCompression
InPhase(BuildPhase.Optimizing)
.Run("Set Mesh Compression", ctx =>
{
var defaultConfig = ctx.AvatarRootObject.GetComponent<MeshCompressionConfig>();
var defaultConfig = ComponentHelper.GetComponentInChildrenWithError<MeshCompressionConfig>(ctx.AvatarRootObject);
var renderers = ctx.AvatarRootObject.GetComponentsInChildren<Renderer>(true);
foreach (var renderer in renderers)