- Home /
Custom Handle. Mutliple Objects
I know how to implement a custom Handle ( let's say a slider) in the OnSceneGUI()-function. Works fine.
OnSceneGUI() {
..
var t = (MyScript)target;
t.transform.position = Handles.Slider(t.transform.position, direction);
..
}
But how do you implement multi-object functionality. If multiple objects, with the same type are selected, I want to drag them all at once, just like the basic Position Handle. The solution above would create an individual handle for each instance selected.
Any ideas?
What did not work so far:
OnSceneGUI() using targets[], applying my change with for-each loop
calculating a deltaMovement of my handle, storing it in a static variable and let each target update itself since OnSceneGUI is called on each instance.(laggy as hell)
Calculating an overall center-position and setting the handle position right there will result in overlapping handles.
Your answer
Follow this Question
Related Questions
Custom Handle, affect multiple objects 1 Answer
How to disable the default transform gizmo in editor? 1 Answer
Interactive handles inside Handles.BeginGUI section 0 Answers
How to read the current PivotRotation or PivotMode ? 1 Answer
Finding a GameObject in an editor script based on position 2 Answers