RotationField() public méthode

public RotationField ( ) : void
Résultat void
Exemple #1
0
        void Inspector3D()
        {
            EditorGUILayout.PropertyField(m_Position, s_Contents.positionContent);
            m_RotationGUI.RotationField();
            Transform t = target as Transform;

            if (t != null && m_ConstrainProportionsScale.Initialize(serializedObject.targetObjects) && m_ConstrainProportionsScaleProperty != null)
            {
                //AxisModified values [-1;2] : [none, x, y, z]
                int     axisModified = -1;
                var     mixedFields  = ConstrainProportionsTransformScale.GetMixedValueFields(m_Scale);
                Vector3 currentScale = m_ConstrainProportionsScale.DoGUI(EditorGUILayout.GetControlRect(true),
                                                                         s_Contents.scaleContent, m_Scale.vector3Value, serializedObject.targetObjects, ref axisModified, m_Scale, m_ConstrainProportionsScaleProperty);
                var mixedFieldsAfterGUI = ConstrainProportionsTransformScale.GetMixedValueFields(m_Scale);

                if (currentScale != m_Scale.vector3Value || mixedFields != mixedFieldsAfterGUI)
                {
                    if (serializedObject.targetObjectsCount > 1)
                    {
                        if (mixedFields != mixedFieldsAfterGUI)
                        {
                            axisModified = -1;
                            for (int i = 0; i < 3; i++)
                            {
                                if (ConstrainProportionsTransformScale.IsBit(mixedFields, i) && !ConstrainProportionsTransformScale.IsBit(mixedFieldsAfterGUI, i))
                                {
                                    axisModified = i;
                                    break;
                                }
                            }
                        }

                        if (axisModified != -1)
                        {
                            m_IsScaleDirty = ConstrainProportionsTransformScale.HandleMultiSelectionScaleChanges(
                                m_Scale.vector3Value,
                                currentScale, m_ConstrainProportionsScale.constrainProportionsScale,
                                serializedObject.targetObjects, ref axisModified);
                        }
                    }

                    if (currentScale != m_Scale.vector3Value)
                    {
                        m_Scale.vector3Value = currentScale;
                    }
                }
            }
            else
            {
                EditorGUILayout.PropertyField(m_Scale, s_Contents.scaleContent);
            }
        }
Exemple #2
0
 private void Inspector3D()
 {
     EditorGUILayout.PropertyField(m_Position, s_Contents.positionContent);
     m_RotationGUI.RotationField();
     EditorGUILayout.PropertyField(m_Scale, s_Contents.scaleContent);
 }