26 lines
No EOL
942 B
C#
26 lines
No EOL
942 B
C#
using UnityEngine.UIElements;
|
|
|
|
/// <summary>
|
|
/// class that inherits from OklchColourPickerUI for the demo colour picker on the DefaultView
|
|
/// </summary>
|
|
public class DemoOklchColourPicker : OklchColourPickerUI
|
|
{
|
|
/// <summary>
|
|
/// initialise the ui elements and register change event callbacks functions
|
|
/// </summary>
|
|
public new void OnEnable()
|
|
{
|
|
var ui = GetComponent<UIDocument>().rootVisualElement;
|
|
|
|
LightnessSlider = ui.Q<Slider>("DemoResponseLightnessSlider");
|
|
LightnessSlider.RegisterCallback<ChangeEvent<float>>(OnLightnessChange);
|
|
|
|
ChromaSlider = ui.Q<Slider>("DemoResponseChromaSlider");
|
|
ChromaSlider.RegisterCallback<ChangeEvent<float>>(OnChromaChange);
|
|
|
|
HueSlider = ui.Q<Slider>("DemoResponseHueSlider");
|
|
HueSlider.RegisterCallback<ChangeEvent<float>>(OnHueChange);
|
|
|
|
ResponseColour = ui.Q<VisualElement>("DemoResponseColour");
|
|
}
|
|
} |