#if MA_VRCSDK3_AVATARS && UNITY_2022_1_OR_NEWER using System; using UnityEditor; using UnityEngine.UIElements; using Toggle = UnityEngine.UIElements.Toggle; namespace nadena.dev.modular_avatar.core.editor.Parameters { [CustomPropertyDrawer(typeof(ParameterConfig))] internal class ParameterConfigDrawer : PropertyDrawer { public override VisualElement CreatePropertyGUI(SerializedProperty property) { var rootPath = "Packages/nadena.dev.modular-avatar/Editor/Inspector/Parameters"; var uss = AssetDatabase.LoadAssetAtPath(rootPath + "/Parameters.uss"); var uxml = AssetDatabase.LoadAssetAtPath(rootPath + "/ParameterConfigDrawer.uxml"); var root = uxml.CloneTree(); Localization.UI.Localize(root); root.styleSheets.Add(uss); // Prototype UI var proot = root.Q("Root"); var type_field = proot.Q("f-type"); SetupPairedDropdownField( proot, type_field, proot.Q("f-sync-type"), proot.Q("f-is-prefix"), ("Bool", "False", "params.syncmode.Bool"), ("Float", "False", "params.syncmode.Float"), ("Int", "False", "params.syncmode.Int"), ("Not Synced", "False", "params.syncmode.NotSynced"), (null, "True", "params.syncmode.PhysBonesPrefix") ); var internalParamAccessor = proot.Q("f-internal-parameter"); internalParamAccessor.RegisterValueChangedCallback(evt => { if (evt.newValue) proot.AddToClassList("st-internal-parameter"); else proot.RemoveFromClassList("st-internal-parameter"); }); var remapTo = proot.Q("f-remap-to"); var defaultParam = proot.Q