0
\$\begingroup\$

I am making a tools using Handles.PositionHandle(). It create a movable 3D handle in the scene view.

I use that code to move an object with it:

    EditorGUI.BeginChangeCheck();

    Vector3 position = Tools.handlePosition;

    using (new Handles.DrawingScope(Color.green))
    {
        position = Handles.PositionHandle(position, Tools.handleRotation);
    }

    if (EditorGUI.EndChangeCheck())
    {
        Vector3 delta = Tools.handlePosition - position;
        //here do some stuffs with the delta
    }

I would like to have an event OnBegin(), and OnEnd(), for doing special action. How can I do ? Thanks !

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.