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

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