diff options
| author | yum <yum.food.vr@gmail.com> | 2025-02-19 16:16:39 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-02-19 16:16:39 -0800 |
| commit | 0d50a7e8483d97e03cae8050732df83eba33f31f (patch) | |
| tree | ed7e79681388825742aa9fc64a20a5f4dc490aa8 /Scripts/YOTSNDMFGenerator.cs | |
| parent | 63b60932ba5500d0c26c3237705edd896c8a4d6f (diff) | |
Menus no longer implicitly go under /YOTS
Diffstat (limited to 'Scripts/YOTSNDMFGenerator.cs')
| -rw-r--r-- | Scripts/YOTSNDMFGenerator.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Scripts/YOTSNDMFGenerator.cs b/Scripts/YOTSNDMFGenerator.cs index 525953c..602c247 100644 --- a/Scripts/YOTSNDMFGenerator.cs +++ b/Scripts/YOTSNDMFGenerator.cs @@ -90,7 +90,7 @@ namespace YOTS return;
}
// Create copies so the originals don't get modified
- menu = UnityEngine.Object.Instantiate(menu);
+ menu = DeepCopyMenu(menu);
parameters = UnityEngine.Object.Instantiate(parameters);
descriptor.expressionsMenu = menu;
descriptor.expressionParameters = parameters;
@@ -166,6 +166,18 @@ namespace YOTS private class YOTSBuildState {
public string jsonConfig;
}
+
+ private static VRCExpressionsMenu DeepCopyMenu(VRCExpressionsMenu sourceMenu) {
+ var copiedMenu = UnityEngine.Object.Instantiate(sourceMenu);
+ // Deep copy all submenu references
+ for (int i = 0; i < copiedMenu.controls.Count; i++) {
+ var control = copiedMenu.controls[i];
+ if (control.type == VRCExpressionsMenu.Control.ControlType.SubMenu) {
+ control.subMenu = DeepCopyMenu(control.subMenu);
+ }
+ }
+ return copiedMenu;
+ }
}
}
|
