From 33fa467abb428be752947def81fa32510a2d8c9e Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 9 Nov 2025 14:11:17 -0800 Subject: add `disabled` field --- Scripts/YOTSCore.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Scripts') 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 parentConstraintWeights = new List(); @@ -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"); } -- cgit v1.2.3