EditorScripting: Handles

hopefully a really quick question… I’m having a play around with creating custom editor “tools” for a few of my scripts and I’m struggling a little with the handles.

Lets take the standard primitive sphere when you choose to “edit collider” on its sphere collider.

2746410--197967--upload_2016-8-10_0-10-10.png

If we’re going to replicate this as a learning exercise to me this looks like 3 wirediscs

but I’m a little lost on what the small handles are (circled)… I think they’re dotcaps
https://docs.unity3d.com/ScriptReference/Handles.DotCap.html

but if you pass the dotcap into something like ScaleValueHandle as a capFunc

they’re huge.
But it’s not entirely clear how you reduce the size of the cap within that function (i.e. what is controlID then supposed to be? :face_with_spiral_eyes: Also a little confused as to what the different types of handle (FreeMoveHandle vs ScaleValueHandle vs …) are for given that the cap image is passed as a parameter :face_with_spiral_eyes:

Only verbose tutorials I’ve found so far seem to be out of date (back when SceneGUI.EndHandles() was a thing) or seem to suggest the small dot handles magically appear when the disc/arc/whatever are added which they don’t now (or never did and they’ve skipped that bit :rage: ); and the docs aren’t particularly detailed.

Looking for some pointers, or if someone knows of a up to date guide/tutorial that would be awesome :smile:

bump

eventually found out that the image above is a radiusHandle… so not a great example :roll_eyes:

only way I could do similar dotcaps which weren’t ridiculously large though was through

float handleSizeScalar = 0.05f;
HandleUtility.GetHandleSize(pos) * handleSizeScalar; // put into the handle's size parameter

which seems to go against all the documentation (that seems to suggest I shouldn’t need the scalar), so I’m not sure if that’s right even though it works…

this week’s questions on handles

2754488--198693--upload_2016-8-16_23-18-55.png2754488--198695--upload_2016-8-16_23-19-21.png

anyone know how I can put text into the handles such that I can control the orientation, ideally I want the text to be in the same plane as the disc, the “Handle.Label” is a always facing the camera kinda deal…

can we add our own custom sprites as handles? (kinda want a padlock icon to lock the two arcs into symmetrical or not)

(or is there something in gizmos or where ever that would let me do those things in an editor script?)

edit: if not I guess I’m going with a little IM gui box in the scene view :smile: