UnityEditor.SpriteEditorWindow.DoPivotFields C# (CSharp) Method

DoPivotFields() private method

private DoPivotFields ( ) : void
return void
        private void DoPivotFields()
        {
            EditorGUI.BeginChangeCheck();
            this.selected.m_Alignment = (SpriteAlignment) EditorGUILayout.Popup(SpriteUtilityWindow.Styles.s_PivotLabel, (int) this.selected.m_Alignment, SpriteUtilityWindow.Styles.spriteAlignmentOptions, new GUILayoutOption[0]);
            Vector2 pivot = this.selected.m_Pivot;
            Vector2 customOffset = pivot;
            EditorGUI.BeginDisabledGroup(this.selected.m_Alignment != SpriteAlignment.Custom);
            Rect position = GUILayoutUtility.GetRect(322f, 322f, (float) 32f, (float) 32f);
            GUI.SetNextControlName("PivotField");
            customOffset = EditorGUI.Vector2Field(position, "Custom Pivot", pivot);
            EditorGUI.EndDisabledGroup();
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(this.m_RectsCache, "Change Sprite Pivot");
                this.textureIsDirty = true;
                this.selected.m_Pivot = SpriteEditorUtility.GetPivotValue(this.selected.m_Alignment, customOffset);
            }
        }