Пример #1
0
        private static TileTransformInfo Draw(Rect position, GUIContent label, Sprite sprite, int rotation, bool horizontal, bool vertical)
        {
            var rect       = EditorGUI.PrefixLabel(position, label);
            var spriteRect = RectHelper.TakeWidth(ref rect, Height);

            RectHelper.TakeHorizontalSpace(ref rect);
            var rotationRect   = RectHelper.TakeLine(ref rect);
            var horizontalRect = RectHelper.TakeLine(ref rect);
            var verticalRect   = RectHelper.TakeLine(ref rect);

            var info = new TileTransformInfo
            {
                Sprite         = EditorGUI.ObjectField(spriteRect, sprite, typeof(Sprite), false) as Sprite,
                Rotation       = EditorGUI.IntPopup(rotationRect, _rotationContent.Content, rotation, _rotationsContent, TileTransformInfo.Rotations),
                FlipHorizontal = EditorGUI.Toggle(horizontalRect, _flipHorizontalContent.Content, horizontal),
                FlipVertical   = EditorGUI.Toggle(verticalRect, _flipVerticalContent.Content, vertical)
            };

            return(info);
        }
Пример #2
0
 public static TileTransformInfo Draw(Rect position, GUIContent label, TileTransformInfo info)
 {
     return(Draw(position, label, info.Sprite, info.Rotation, info.FlipHorizontal, info.FlipVertical));
 }
Пример #3
0
        public static TileTransformInfo Draw(GUIContent label, TileTransformInfo info)
        {
            var position = EditorGUILayout.GetControlRect(label != null, Height);

            return(Draw(position, label, info));
        }