I'm trying to code an Editor-only window similar to Animation or Timeline. At present, stucking in the slider thumb, which usually looks like a vertical line across the tracks. Two ideas to implement it: 1.Customize the GUIStyle of thumb. But it seems that the thumb image cannot display out of slider rect. 2.Get position of thumb on window, and draw a vertical line individually. But for the first step, I haven't found any way given by Unity.

Of course, without any other solution, maybe I can forget about the GUI Slider and make it by myself, but sounds not an efficient plan, I hate doing this:P

Need some tips, thanks a lot.

1

There are 1 best solutions below

0
On

If you're set to do a custom Editor window or panel, drop IMGUI coding completely and switch to UIToolkit as the Editor supports it now. Start here. UI Toolkit is the newest UI Framework in Unity and is also available for runtime builds.

While legacy IMGUI still works I would guess that Unity Technologies will remove it from the libraries once the Editor will be fully migrated to UI Toolkit. And while it's not 100% done, it's quite stable and the features are quite spread out.