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

@ -2,6 +2,7 @@ using System.Linq;
using System.Diagnostics;
using AnimatorAsCode.V1;
using gay.lilyy.aaccore;
using gay.lilyy.Common;
using nadena.dev.ndmf;
using AnimatorAsCode.V1.ModularAvatar;
using UnityEditor;
@ -164,7 +165,7 @@ namespace gay.lilyy.aaccore
var overallStopwatch = Stopwatch.StartNew();
V5AACLogger.LogInfo("Starting Lillith V5 AAC generation...");
var root = ctx.AvatarRootObject.GetComponent<AACRoot>();
var root = ComponentHelper.GetComponentInChildrenWithError<AACRoot>(ctx.AvatarRootObject);
if (root == null)
{
V5AACLogger.LogInfo("No LillithV5AACRoot component found. Skipping.");

View file

@ -11,7 +11,8 @@
"GUID:901e56b065a857d4483a77f8cae73588",
"GUID:04a7e5cf006503242b1db329a84d694d",
"GUID:95124d49b8c897e4286f0bf6c6e57f4d",
"GUID:a65a5779a3702144986d83fca255f5da"
"GUID:a65a5779a3702144986d83fca255f5da",
"GUID:209cbd2a789c4f72963fdbf1f8a01909"
],
"includePlatforms": [
"Editor"

View file

@ -11,7 +11,8 @@
"GUID:04a7e5cf006503242b1db329a84d694d",
"GUID:62ced99b048af7f4d8dfe4bed8373d76",
"GUID:e73da13578f7b4d4fa785d6f8fe72ba3",
"GUID:fc900867c0f47cd49b6e2ae4ef907300"
"GUID:fc900867c0f47cd49b6e2ae4ef907300",
"GUID:209cbd2a789c4f72963fdbf1f8a01909"
],
"includePlatforms": [
"Editor"

View file

@ -4,6 +4,7 @@ using AnimatorAsCode.V1;
using System.Collections.Generic;
using gay.lilyy.aaccore;
using gay.lilyy.aacshared.runtimecomponents;
using gay.lilyy.Common;
namespace gay.lilyy.aacshared.layers
{
@ -30,7 +31,7 @@ namespace gay.lilyy.aacshared.layers
public override bool IsApplicable(AACAssets assets)
{
var definition = assets.ctx.AvatarRootObject.GetComponent<LanternFlickerDefinition>();
var definition = ComponentHelper.GetComponentInChildrenWithError<LanternFlickerDefinition>(assets.ctx.AvatarRootObject);
if (definition == null) return false;
if (!definition.enabled) return false;
var lamp = GetLantern(assets);