fix(rc): constant-off objects are not handled correctly (#1249)

Closes: #1233
This commit is contained in:
bd_ 2024-10-02 19:42:19 -07:00 committed by GitHub
parent 02204c272f
commit 409592f952
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -35,7 +35,9 @@ namespace nadena.dev.modular_avatar.core.editor
public bool Inverted;
public bool IsConstant => ControllingConditions.Count == 0 || ControllingConditions.All(c => c.IsConstant);
public bool IsConstant => ControllingConditions.Count == 0
|| ControllingConditions.All(c => c.IsConstant)
|| ControllingConditions.Any(c => c.IsConstant && !c.InitiallyActive);
public bool IsConstantOn => IsConstant && InitiallyActive;
public override string ToString()

View File

@ -144,7 +144,7 @@ namespace nadena.dev.modular_avatar.core.editor
HashSet<GameObject> toggledObjects = new();
if (asc == null) return;
foreach (var targetProp in shapes.Keys)
if (targetProp is { TargetObject: GameObject go, PropertyName: "m_IsActive" })
toggledObjects.Add(go);

View File

@ -183,7 +183,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &569625391371299408
Transform:
m_ObjectHideFlags: 0
@ -250,6 +250,7 @@ MonoBehaviour:
isSynced: 1
isSaved: 1
isDefault: 0
automaticValue: 0
--- !u!114 &664065153831629983
MonoBehaviour:
m_ObjectHideFlags: 0