DebugAlignment() public static method

public static DebugAlignment ( Quaternion targetRotation ) : void
targetRotation UnityEngine.Quaternion
return void
Exemplo n.º 1
0
        public override void ToolGUI(SceneView view, Vector3 handlePosition, bool isStatic)
        {
            Quaternion targetRotation = (Selection.transforms.Length <= 1) ? Tools.handleLocalRotation : Tools.handleRotation;

            TransformManipulator.DebugAlignment(targetRotation);
            if (Event.current.type == EventType.MouseDown)
            {
                s_CurrentScale = Vector3.one;
            }
            EditorGUI.BeginChangeCheck();
            TransformManipulator.BeginManipulationHandling(true);
            s_CurrentScale = Handles.ScaleHandle(s_CurrentScale, handlePosition, targetRotation, HandleUtility.GetHandleSize(handlePosition));
            TransformManipulator.EndManipulationHandling();
            if (EditorGUI.EndChangeCheck() && !isStatic)
            {
                TransformManipulator.SetScaleDelta(s_CurrentScale, targetRotation);
            }
        }
Exemplo n.º 2
0
        public override void ToolGUI(SceneView view, Vector3 handlePosition, bool isStatic)
        {
            Quaternion quaternion = Selection.transforms.Length <= 1 ? Tools.handleLocalRotation : Tools.handleRotation;

            TransformManipulator.DebugAlignment(quaternion);
            if (Event.current.type == EventType.MouseDown)
            {
                ScaleTool.s_CurrentScale = Vector3.one;
            }
            EditorGUI.BeginChangeCheck();
            TransformManipulator.BeginManipulationHandling(true);
            ScaleTool.s_CurrentScale = Handles.ScaleHandle(ScaleTool.s_CurrentScale, handlePosition, quaternion, HandleUtility.GetHandleSize(handlePosition));
            int num = (int)TransformManipulator.EndManipulationHandling();

            if (!EditorGUI.EndChangeCheck() || isStatic)
            {
                return;
            }
            TransformManipulator.SetScaleDelta(ScaleTool.s_CurrentScale, quaternion);
        }
Exemplo n.º 3
0
        protected override void ToolGUI(SceneView view, Vector3 handlePosition, bool isStatic)
        {
            // Allow global space scaling for multi-selection but not for a single object
            Quaternion handleRotation = Selection.transforms.Length > 1 ?
                                        Tools.handleRotation : Tools.handleLocalRotation;

            TransformManipulator.DebugAlignment(handleRotation);

            if (Event.current.type == EventType.MouseDown)
            {
                s_CurrentScale = Vector3.one;
            }

            EditorGUI.BeginChangeCheck();

            TransformManipulator.BeginManipulationHandling(true);
            s_CurrentScale = Handles.ScaleHandle(s_CurrentScale, handlePosition, handleRotation, HandleUtility.GetHandleSize(handlePosition));
            TransformManipulator.EndManipulationHandling();

            if (EditorGUI.EndChangeCheck() && !isStatic)
            {
                TransformManipulator.SetScaleDelta(s_CurrentScale, handleRotation);
            }
        }