Exemplo n.º 1
0
        private static void DrawButtons()
        {
            // Position

            // Set position functions
            QtFunctions.SetFunctions(true, true, 0);

            // Reset position functions
            QtFunctions.ResetFunctions(true, 0);

            // Draw a separator
            QtUtility.DrawPopupSeparator();

            // Rotation

            // Set position functions
            QtFunctions.SetFunctions(true, true, 1);

            // Reset position functions
            QtFunctions.ResetFunctions(true, 1);

            // Draw a seperator
            QtUtility.DrawPopupSeparator();

            // Scale

            // Set position functions
            QtFunctions.SetFunctions(true, true, 2);

            // Reset position functions
            QtFunctions.ResetFunctions(true, 2);
        }
Exemplo n.º 2
0
        private void Save(bool perform)
        {
            // Axis
            QtUtility.SaveBool("QT_Rot_xAxis", xAxis);
            QtUtility.SaveBool("QT_Rot_yAxis", yAxis);
            QtUtility.SaveBool("QT_Rot_zAxis", zAxis);

            // Rotition
            QtUtility.SaveFloat("QT_Rot_axis.x", axis.x);
            QtUtility.SaveFloat("QT_Rot_axis.y", axis.y);
            QtUtility.SaveFloat("QT_Rot_axis.z", axis.z);

            // Random  Rotition MIN
            QtUtility.SaveFloat("QT_Rot_randomMin.x", _randomMin.x);
            QtUtility.SaveFloat("QT_Rot_randomMin.y", _randomMin.y);
            QtUtility.SaveFloat("QT_Rot_randomMin.z", _randomMin.z);

            // Random  Rotition MAX
            QtUtility.SaveFloat("QT_Rot_randomMax.x", _randomMax.x);
            QtUtility.SaveFloat("QT_Rot_randomMax.y", _randomMax.y);
            QtUtility.SaveFloat("QT_Rot_randomMax.z", _randomMax.z);

            // Origin
            QtUtility.SaveInt("QT_SetRotOrigin", setRotOrigin);

            QtUtility.SaveInt("QT_SetRotTranslationType", translationType);
            QtUtility.SaveInt("QT_SetRotIsRelative", isRelative);

            // We're performing the action,
            // Since this is all saved in QT_* strings, we can call "redo" since its basically the same thing.
            if (perform)
            {
                QtFunctions.RepeatRotation();
            }
        }
Exemplo n.º 3
0
        private void OnGUI()
        {
            minSize = new Vector2(110, 100);
            if (!_mLoaded)
            {
                Load();
                _mLoaded = true;
            }

            _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos, GUILayout.Width(position.width),
                                                         GUILayout.Height(position.height));

            // Position
            GUILayout.Space(22);
            _rect         = GUILayoutUtility.GetLastRect();
            _showPosition = EditorGUI.Foldout(new Rect(_rect.xMin + 3, _rect.yMin + 3, position.width - 6, 15),
                                              _showPosition, "Position", true, _foldOut);

            if (_showPosition)
            {
                // Set position functions
                QtFunctions.SetFunctions(false, false, 0);

                // Reset position functions
                QtFunctions.ResetFunctions(false, 0);
            }

            // Draw a seperator
            //QTEditorTools.DrawSeparator();
            QtUtility.DrawMiniSeparator();

            // Rotation
            GUILayout.Space(22);
            _rect         = GUILayoutUtility.GetLastRect();
            _showRotation = EditorGUI.Foldout(new Rect(_rect.xMin + 3, _rect.yMin + 3, position.width - 6, 15),
                                              _showRotation, "Rotation", true, _foldOut);

            if (_showRotation)
            {
                // Set position functions
                QtFunctions.SetFunctions(false, false, 1);

                // Reset position functions
                QtFunctions.ResetFunctions(false, 1);
            }

            // Draw a seperator
            //QTEditorTools.DrawSeparator();
            QtUtility.DrawMiniSeparator();

            // Scale
            GUILayout.Space(22);
            _rect      = GUILayoutUtility.GetLastRect();
            _showScale = EditorGUI.Foldout(new Rect(_rect.xMin + 3, _rect.yMin + 3, position.width - 6, 15), _showScale,
                                           "Scale", true, _foldOut);

            if (_showScale)
            {
                // Set position functions
                QtFunctions.SetFunctions(false, false, 2);

                // Reset position functions
                QtFunctions.ResetFunctions(false, 2);
            }

            // Draw a seperator
            //QTEditorTools.DrawSeparator();
            //QTUtility.DrawMiniSeparator();

            // Draw a seperator
            //QTEditorTools.DrawSeparator();

            EditorGUILayout.EndScrollView();
        }