예제 #1
0
파일: GridObject.cs 프로젝트: gg12123/Snake
    private void OnExpandedToNewSquares(Direction dir)
    {
        switch (dir)
        {
        case Direction.Up:
        case Direction.Left:
            m_UL = m_UL.Next(dir);
            break;

        case Direction.Down:
        case Direction.Right:
            m_LR = m_LR.Next(dir);
            break;
        }
    }
예제 #2
0
파일: Snake.cs 프로젝트: gg12123/Snake
    private GridSquare SquareOnRectOuter(GridSquare startSquare, Rect rect, Direction dir)
    {
        var next = startSquare.Next(dir);

        while (next.Rect.IsOverlappingWith(rect, dir))
        {
            startSquare = next;
            next        = next.Next(dir);
        }
        return(startSquare);
    }