- Home /
Is it possible to add new tools, like transform/rotate/scale?
I'm writing a spline editor and for each point on my spline I have some additional properties that I want the user to be able to edit in the scene. One such property might be "width". I'm using a Handles.ScaleValueHandle() for this, but this interferes with the handle that is drawn for transform/rotate/scale. If I'm in the Hand Tool then things look a bit better, but then I need to change tool to select another point.
What I'd ideally like to be able to do is to add a new tool that sits next to the hand/transform/rotate/scale tools to let me go into my own editing mode. Is this sort of thing possible?
I notice that the terrain editor has some number of tools that you can select. Is it possible to do this sort of thing in my own script?
Answer by yoyo · Jan 06, 2011 at 05:49 PM
You can create a custom editor for a type, which will be active whenever a component of that type is active in the inspector. (As Jean F says, you can create an editor for Transform, which will then be active for all objects, since they all have transforms -- but it sounds like you just need your editor to be available when your spline component is selected.)
This custom editor can then implement OnSceneGUI, where you can render your gizmo handles and deal with user input.
I don't know if there's a way to add a new button to the scene view toolbar, but if you can stomach the use of reflection to call private members you might be able to inject something into the standard scene view. See this question for an example of these sorts of shenanigans. Alternatively you could add a menu item with a hotkey to activate your manipulator.
Answer by Jean-Fabre · Jan 06, 2011 at 01:42 PM
hi,
Have you checked the antares project?
You could write your own transform inspector and add more items to trigger your own editing tools
check this ( if you don't know it already):
http://www.unifycommunity.com/wiki/index.php?title=TransformInspector
This is a rewriting version of the transform Inspector and a good start to build such editor scripts.
You can then add your own gui , tools and info within that new transform Inspector on ALL of your models. This might be what you are looking for.
Bye,
Jean
Thanks for pointing out the antares project, that looks interesting.
Your answer
![](https://koobas.hobune.stream/wayback/20220613094307im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Changing collider's center changes the position of the position handle? wtf?! 1 Answer
Represent a AnimationCurve smoothly with Handles.Bezier 0 Answers
Custom brush tool? 0 Answers
What is the best way to use the Handles class to create custom gizmos. 1 Answer
How to read the current PivotRotation or PivotMode ? 1 Answer