private void DoBorderFields()
        {
            EditorGUI.BeginChangeCheck();

            Vector4 oldBorder = selectedSpriteBorder;
            int     x         = Mathf.RoundToInt(oldBorder.x);
            int     y         = Mathf.RoundToInt(oldBorder.y);
            int     z         = Mathf.RoundToInt(oldBorder.z);
            int     w         = Mathf.RoundToInt(oldBorder.w);

            SpriteEditorUtility.FourIntFields(new Vector2(kInspectorWidth - kInspectorWindowMargin, EditorGUI.kSingleLineHeight * 2f + EditorGUI.kVerticalSpacingMultiField),
                                              styles.borderLabel,
                                              styles.lLabel,
                                              styles.tLabel,
                                              styles.rLabel,
                                              styles.bLabel,
                                              ref x, ref w, ref z, ref y);

            Vector4 newBorder = new Vector4(x, y, z, w);

            if (EditorGUI.EndChangeCheck())
            {
                selectedSpriteBorder = newBorder;
            }
        }
Example #2
0
        private void DoPositionField()
        {
            EditorGUI.BeginChangeCheck();
            Rect selectedSpriteRect = this.selectedSpriteRect;
            int  num  = Mathf.RoundToInt(selectedSpriteRect.x);
            int  num2 = Mathf.RoundToInt(selectedSpriteRect.y);
            int  num3 = Mathf.RoundToInt(selectedSpriteRect.width);
            int  num4 = Mathf.RoundToInt(selectedSpriteRect.height);

            SpriteEditorUtility.FourIntFields(new Vector2(322f, 32f), SpriteFrameModuleBase.styles.positionLabel, SpriteFrameModuleBase.styles.xLabel, SpriteFrameModuleBase.styles.yLabel, SpriteFrameModuleBase.styles.wLabel, SpriteFrameModuleBase.styles.hLabel, ref num, ref num2, ref num3, ref num4);
            if (EditorGUI.EndChangeCheck())
            {
                this.selectedSpriteRect = new Rect((float)num, (float)num2, (float)num3, (float)num4);
            }
        }
Example #3
0
        private void DoBorderFields()
        {
            EditorGUI.BeginChangeCheck();
            Vector4 selectedSpriteBorder = this.selectedSpriteBorder;
            int     num  = Mathf.RoundToInt(selectedSpriteBorder.x);
            int     num2 = Mathf.RoundToInt(selectedSpriteBorder.y);
            int     num3 = Mathf.RoundToInt(selectedSpriteBorder.z);
            int     num4 = Mathf.RoundToInt(selectedSpriteBorder.w);

            SpriteEditorUtility.FourIntFields(new Vector2(322f, 32f), SpriteFrameModuleBase.styles.borderLabel, SpriteFrameModuleBase.styles.lLabel, SpriteFrameModuleBase.styles.tLabel, SpriteFrameModuleBase.styles.rLabel, SpriteFrameModuleBase.styles.bLabel, ref num, ref num4, ref num3, ref num2);
            Vector4 selectedSpriteBorder2 = new Vector4((float)num, (float)num2, (float)num3, (float)num4);

            if (EditorGUI.EndChangeCheck())
            {
                this.selectedSpriteBorder = selectedSpriteBorder2;
            }
        }
        private void DoPositionField()
        {
            EditorGUI.BeginChangeCheck();

            Rect oldRect = selectedSpriteRect;
            int  x       = Mathf.RoundToInt(oldRect.x);
            int  y       = Mathf.RoundToInt(oldRect.y);
            int  w       = Mathf.RoundToInt(oldRect.width);
            int  h       = Mathf.RoundToInt(oldRect.height);

            SpriteEditorUtility.FourIntFields(new Vector2(kInspectorWidth - kInspectorWindowMargin, EditorGUI.kSingleLineHeight * 2f + EditorGUI.kVerticalSpacingMultiField),
                                              styles.positionLabel,
                                              styles.xLabel,
                                              styles.yLabel,
                                              styles.wLabel,
                                              styles.hLabel,
                                              ref x, ref y, ref w, ref h);

            if (EditorGUI.EndChangeCheck())
            {
                selectedSpriteRect = new Rect(x, y, w, h);
            }
        }