Ejemplo n.º 1
0
 /// <summary>
 /// 更新动态渲染格
 /// 不需要public
 /// </summary>
 /// <param name="count"></param>
 void _UpdateDynmicRects(int count)
 {
     _dictDRect = new Dictionary <int, DynamicRect>();
     for (int i = 0; i < count; ++i)
     {
         int         row    = i / columnCount;
         int         column = i % columnCount;
         DynamicRect dRect  = new DynamicRect(column * _GetBlockSizeX(), -row * _GetBlockSizeY() - cellSize.y, cellSize.x, cellSize.y, i);
         _dictDRect[i] = dRect;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 通过动态格子获得动态渲染器
        /// </summary>
        /// <param name="rect"></param>
        /// <returns></returns>
        DynamicInfinityItem _GetDynmicItem(DynamicRect rect)
        {
            int len = _listItems.Count;

            for (int i = 0; i < len; ++i)
            {
                DynamicInfinityItem item = _listItems[i];
                if (item.DRect == null)
                {
                    continue;
                }
                if (rect.Index == item.DRect.Index)
                {
                    return(item);
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 是否相交
 /// </summary>
 /// <param name="otherRect"></param>
 /// <returns></returns>
 public bool Overlaps(DynamicRect otherRect)
 {
     return(_rect.Overlaps(otherRect._rect));
 }