summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-11-09 14:11:17 -0800
committeryum <yum.food.vr@gmail.com>2025-11-09 14:11:17 -0800
commit33fa467abb428be752947def81fa32510a2d8c9e (patch)
treed28890ec2573b56651be4e2d60efc45f23818d55 /Scripts
parentce52a617927f9fd778ca48c27151a23dc4a3fc31 (diff)
add `disabled` field
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/YOTSCore.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Scripts/YOTSCore.cs b/Scripts/YOTSCore.cs
index d76f382..2d88081 100644
--- a/Scripts/YOTSCore.cs
+++ b/Scripts/YOTSCore.cs
@@ -88,6 +88,10 @@ namespace YOTS
[SerializeField]
public bool disableMenuEntry = false;
+ // If true, it's as if this ToggleSpec doesn't exist.
+ [SerializeField]
+ public bool disabled = false;
+
// Parent constraint weights to animate
[SerializeField]
public List<ParentConstraintWeight> parentConstraintWeights = new List<ParentConstraintWeight>();
@@ -317,6 +321,11 @@ namespace YOTS
if (config == null) {
throw new ArgumentException("JSON config is empty or invalid");
}
+
+ // Remove disabled specs upon ingest so that the usual checks apply.
+ int n_removed = config.toggles.RemoveAll(spec => spec.disabled);
+ Debug.Log($"Removed {n_removed} disabled toggles");
+
if (config.toggles == null) {
throw new ArgumentException("No toggleSpecs found in configuration");
}