fix: missing observations in LocateReactions (#1210)

This commit is contained in:
bd_ 2024-09-25 20:01:55 -07:00 committed by GitHub
parent de1744b080
commit 13b0ffe0b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,7 +82,7 @@ namespace nadena.dev.modular_avatar.core.editor
Parameter = GetActiveSelfProxy(cursor.gameObject), Parameter = GetActiveSelfProxy(cursor.gameObject),
DebugName = cursor.gameObject.name, DebugName = cursor.gameObject.name,
IsConstant = false, IsConstant = false,
InitialValue = cursor.gameObject.activeSelf ? 1.0f : 0.0f, InitialValue = _computeContext.Observe(cursor.gameObject, go => go.activeSelf) ? 1.0f : 0.0f,
ParameterValueLo = 0.5f, ParameterValueLo = 0.5f,
ParameterValueHi = float.PositiveInfinity, ParameterValueHi = float.PositiveInfinity,
ReferenceObject = cursor.gameObject, ReferenceObject = cursor.gameObject,
@ -228,7 +228,8 @@ namespace nadena.dev.modular_avatar.core.editor
if (!objectGroups.TryGetValue(key, out var group)) if (!objectGroups.TryGetValue(key, out var group))
{ {
group = new AnimatedProperty(key, target.activeSelf ? 1 : 0); var active = _computeContext.Observe(target, t => t.activeSelf);
group = new AnimatedProperty(key, active ? 1 : 0);
objectGroups[key] = group; objectGroups[key] = group;
} }