예제 #1
0
        void Rotate()
        {
            var newPoints = falling.Rotate();

            foreach (var p in newPoints)
            {
                var x = piecePos.x + p.x;
                var y = piecePos.y + p.y;
                if (x < 0 || x >= width || y < 0 || y >= height || !IsFree(x, y))
                {
                    return;
                }
            }
            falling.Assign(newPoints);
            int i = 0;

            if (useSpriteRenderer)
            {
                foreach (var p in falling.points)
                {
                    if (falling.views [i])
                    {
                        falling.views [i++].localPosition = new Vector3(p.x, p.y);
                    }
                }
            }
            UpdateView();
        }