Пример #1
0
 public Rectangle GetFrameRectangle(Vec2I framePos)
 {
     return new Rectangle(
         framePos.x * FrameGrid.Size.x,
         framePos.y * FrameGrid.Size.y,
         FrameGrid.Size.x,
         FrameGrid.Size.y);
 }
Пример #2
0
        private void AddCollisionAt(Vec2I anchor, int x, int y)
        {
            if (x >= Width || x < 0 || y >= Height || y < 0)
                return;

            if (m_collisionMap[x, y] == null)
            {
                m_collisionMap[x, y] = new HashSet<Vec2I>();
            }

            m_collisionMap[x, y].Add(anchor);
        }