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

@ -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);