Пример #1
0
        public SAPageList(IFactory itemFacotry, GameObject parentSkin, int itemWidth = 0, int itemHeight = 0,
                          bool vertical = true, int maxColumn = -1)
        {
            _itemFacotry = itemFacotry;
            _vertical    = vertical;

            this.MaxColumn = maxColumn;

            if (itemWidth == 0 && itemHeight == 0)
            {
                ISizeFactory a = itemFacotry as ISizeFactory;
                if (a != null)
                {
                    itemWidth  = a.itemWidth;
                    itemHeight = a.itemHeight;
                }
            }

            _itemSize = new Vector2(itemWidth, itemHeight);
            updateItemBound();
            this.skin = parentSkin;
        }
Пример #2
0
 internal static object ParseSize(ISizeFactory sizeFactory, string s)
 {
     string[] parts = s.Split('x');
     return(sizeFactory.GetSize(int.Parse(parts[0]), int.Parse(parts[1])));
 }