Cheers for the info, it pointed me in the right direction.
The easiest way I found to do this is to name the Control using GUI.SetNextControlName ( “…” ).
Unfortunately as some of the Handles ( PositionHandle ) create multiple controls only
the first one will be named, but it easy enough to build your own from the components
provided.
Take the PositionHandle as an example we can add the following function to recreate
it from the other handles provided. As you can see we set the name of each of the
controls, this will let us use the function GUI.GetNameOfFocusedControl () to get the
name of the control and use that to lookup an array or dictionary to find the related
item.
Vector3 PositionHandle ( Vector3 position, Quaternion rotation, string name )
{
// right Axis
GUI.SetNextControlName ( name );
Handles.color = new Color ( 1.0f, 0.0f, 0.0f, 0.75f );
Vector3 newPos = Handles.Slider ( position, rotation*Vector3.right );
// Up Axis
GUI.SetNextControlName ( name );
Handles.color = new Color ( 0.0f, 1.0f, 0.0f, 0.75f );
newPos += Handles.Slider ( position, rotation*Vector3.up ) - position;
// Forward Axis
GUI.SetNextControlName ( name );
Handles.color = new Color ( 0.0f, 0.0f, 1.0f, 0.75f );
newPos += Handles.Slider ( position, rotation*Vector3.forward ) - position;
float sizeMultiplier = 0.0f;
if ( Camera.current.orthographic )
{
sizeMultiplier = Camera.current.orthographicSize * 2.5f;
}
else
{
Plane screen = new Plane ( Camera.current.transform.forward, Camera.current.transform.position );
screen.Raycast ( new Ray ( position, Camera.current.transform.forward ), out sizeMultiplier );
}
GUI.SetNextControlName ( name );
Handles.color = new Color ( 1.0f, 1.0f, 1.0f, 0.75f );
newPos += Handles.FreeMoveHandle ( position, rotation, 0.02f * sizeMultiplier, Vector3.zero, Handles.RectangleCap ) - position;
}