var slider = detailsWindow.Q<UnityEngine.UIElements.Slider>();
slider.RegisterValueChangedCallback(SyncValue);
private void SyncValue(ChangeEvent<float> evt)
{
var target = evt.target as Slider;
asset.SliderValue = evt.newValue;
}
Unity - Scripting API: ChangeEvent<T0>
Slider Control
all field-like controls (which are by default used in inspectors as
fields) have a bunch of styles that come with built-in selectors.
Slider is one of those controls, so a lot of styles come from
.unity-base-field (and all of its siblings and children); the Label's
width for instance is dictated by .unity-base-field__label's min-width
of 150px (BaseField behaviour by default). You can remove this by
specifying a different setting for that property in your own selector
(e.g. min-width: auto.
The Slider element is straight up broken
Unity - Manual: Expose custom control to UXML and UI Builder
Features
Official - Introducing the Vector API in Unity 2022.1
https://github.com/breadnone/UTK-Fluent-extension-for-UIToolkit
https://github.com/LibraStack/UnityMvvmToolkit
Examples
Official - Share your UI Toolkit projects