UnityEditor.TransformManipulator.BeginManipulationHandling C# (CSharp) Method

BeginManipulationHandling() public static method

public static BeginManipulationHandling ( bool lockHandleWhileDragging ) : void
lockHandleWhileDragging bool
return void
        public static void BeginManipulationHandling(bool lockHandleWhileDragging)
        {
            BeginEventCheck();
            s_LockHandle = lockHandleWhileDragging;
        }

Usage Example

        protected override void ToolGUI(SceneView view, Vector3 handlePosition, bool isStatic)
        {
            TransformManipulator.BeginManipulationHandling(false);
            EditorGUI.BeginChangeCheck();

            // The AimConstraint changes the rotation of the active object as the object is moved around in the scene.
            // This leads to very large "jumps" of the object,
            // as the move tool assumes the handle rotation to not change while the object is dragged.
            // Solution: when moving an object constrained with the AimConstraint, we ignore the rotation of the object.
            Quaternion handleRotation         = Tools.handleRotation;
            var        aimConstraintComponent = Selection.activeTransform.GetComponent <UnityEngine.Animations.AimConstraint>();

            if (aimConstraintComponent != null && aimConstraintComponent.constraintActive)
            {
                handleRotation = TransformManipulator.mouseDownHandleRotation;
            }

            Vector3 pos2 = Handles.PositionHandle(handlePosition, handleRotation);

            if (EditorGUI.EndChangeCheck() && !isStatic && TransformManipulator.HandleHasMoved(pos2))
            {
                ManipulationToolUtility.SetMinDragDifferenceForPos(handlePosition);

                if (Tools.vertexDragging)
                {
                    ManipulationToolUtility.DisableMinDragDifference();
                }

                TransformManipulator.SetPositionDelta(pos2, TransformManipulator.mouseDownHandlePosition);
            }
            TransformManipulator.EndManipulationHandling();
        }
All Usage Examples Of UnityEditor.TransformManipulator::BeginManipulationHandling