예제 #1
0
파일: UiUtility.cs 프로젝트: Bgoon/GKit
        public static void SetVerticalAlignment(this RectTransform rectTransform, VerticalAlignment alignment)
        {
            GRange anchorRange = GetAnchorRange(alignment);

            rectTransform.anchorMin = new Vector2(rectTransform.anchorMin.x, anchorRange.min);
            rectTransform.anchorMax = new Vector2(rectTransform.anchorMax.x, anchorRange.max);
        }
예제 #2
0
파일: UiUtility.cs 프로젝트: Bgoon/GKit
        public static void SetHorizontalAlignment(this RectTransform rectTransform, HorizontalAlignment alignment)
        {
            GRange anchorRange = GetAnchorRange(alignment);

            rectTransform.anchorMin = new Vector2(anchorRange.min, rectTransform.anchorMin.y);
            rectTransform.anchorMax = new Vector2(anchorRange.max, rectTransform.anchorMax.y);
        }
예제 #3
0
 public static UpdateBordersRequest GetInnerCols(GRange range, GBorderLineType lineType)
 {
     return(new UpdateBordersRequest()
     {
         InnerHorizontal = BorderDictionary[lineType],
         Range = range.GetGridRange()
     });
 }
예제 #4
0
 public static UpdateBordersRequest GetOuterBorders(GRange range, GBorderLineType lineType)
 {
     return(new UpdateBordersRequest()
     {
         Bottom = BorderDictionary[lineType],
         Left = BorderDictionary[lineType],
         Right = BorderDictionary[lineType],
         Top = BorderDictionary[lineType],
         Range = range.GetGridRange()
     });
 }
 public static Request GenerateRequest(GMergeType type, GRange range)
 {
     return(new Request()
     {
         MergeCells = new MergeCellsRequest()
         {
             MergeType = GetMergeType(type),
             Range = range.GetGridRange()
         }
     });
 }
 public static Request GenerateRepeatCellRequest(GRange range, GCell cell)
 {
     return(new Request()
     {
         RepeatCell = new RepeatCellRequest()
         {
             Cell = cell.GetCellData(),
             Fields = cell.GetFields(),
             Range = range.GetGridRange()
         }
     });
 }
예제 #7
0
        public static Request GenerateRequest(GUpdateBordersType type, GBorderLineType lineType, GRange range)
        {
            UpdateBordersRequest request;

            switch (type)
            {
            case GUpdateBordersType.InnerRows:
                request = GetInnerRows(range, lineType);
                break;

            case GUpdateBordersType.InnerColumns:
                request = GetInnerCols(range, lineType);
                break;

            case GUpdateBordersType.Outer:
            default:
                request = GetOuterBorders(range, lineType);
                break;
            }

            return(new Request()
            {
                UpdateBorders = request
            });
        }